[Image-SIG] Correct raw mode for 16-bit .bmp files

Alexey Borzenkov snaury at gmail.com
Fri Mar 9 17:40:42 CET 2007


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.


More information about the Image-SIG mailing list