[Image-SIG] Problems visualising an RGB24 image

Jack Jansen jack@oratrix.nl
Sat, 19 Feb 2000 00:51:49 +0100


For converting images with strange byte formats 'img' is still a lot
stronger than pil. With img you can describe the current incore format 
(which in this case would be 24bit pixels with no padding, no stride)
and the wanted incore format (32 bit pixels r,g,b,ignore) and it'll
quickly convert the image.

If someone wants to port this feature from img to pil: be my
guest. This auto-conversion feature is the main reason I still use img 
and haven't switched to pil: on any platform with any image file I can do
   window = whatever-os-call-needed-to-get-a-window()
   format_wanted = imgformat.whatever-the-corresponding-format
   reader = img.reader(filename, format_wanted)
   bitmap = reader.read()
and this will work for any combination of supported image files (from
x-bitmap to png, to name two) and bitmap format (from MacOS 15-bit BGR 
to 1-bit b/w) and produce reasonable results.

The pil bitmap format descriptions aren't strong enough for this (at
least, not last time I checked), as they can't describe packing of
components into pixels, stride, etc. And img will always take the
fastest route from source to destination with the least information
loss (well, it tries to, at least:-).

But, all that said, pil has far more functionality than img, which is
basically only image read/write/display plus the conversions needed
for that (dithering, colormapping, pixelshifting), so merging these
features from img into pil would be a great boon.

Anyone interested in looking into this is invited to check img out, at 
ftp://ftp.cwi.nl/pub/jack/python. And if someone decides to try it let 
me know, as I have a much newer img locally (but never got around to
packing it up again, because there seems to be so little interest in
it). 
--
Jack Jansen             | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.oratrix.nl/~jack    | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm