List Info

Thread: Correct raw mode for 16-bit .bmp files




Correct raw mode for 16-bit .bmp files
user name
2007-03-09 10:40:42
Hi everyone,

Today I stumbled upon a 16-bit .bmp file that when opened
with PIL had
very-very wrong colors. While looking for the cause I
finally read
MSDN documentation on BITMAPINFOHEADER, where it says that
by default
(i.e. when BI_BITFIELDS is not specified in biCompression
field)
16-bit bitmaps have 5-bits for each color band, thus in
BmpImagePlugin.py it should be:

-    16: ("RGB", "BGR;16"),
+    16: ("RGB", "BGR;15"),

I wonder if there's any collision with OS/2 16-bit bitmaps
though?
(don't even know where to start looking for information on
them) If
not it would be good if it could be fixed on trunk.

Thanks,
Alexey.
_______________________________________________
Image-SIG maillist  -  Image-SIGpython.org
htt
p://mail.python.org/mailman/listinfo/image-sig

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )