1bpp and palette usage in image formats



Hi,

In bmp file format, when color depth <= 8, indexes in pallete are used in bitmap
data instead of RGB. Same for ico format, which uses the same
structures in its core, as bmp.

But for both formats, when color depth is 1 (1 bit per pixel), the situation with
using palette seems rather strange:

Some application use palette in this case, assuming that bit=0 corresponds to the first
color in it, and 1 - to the second one.
However, other programs ignore palette, and assume that 0 corresponds to
black and 1 to white.

Some examples:
-Windows XP uses pallete for 1bpp icons
-IrfanView(image viewer for windows) ignores pallete for 1bpp icons
-GIMP uses pallete for 1bpp icons
-gdk_pixbuf_new_from_file() (and corresponding loader) ignores palette
for 1bpp icons
-gdk_pixbuf_new_from_file() (and corresponding loader) uses palette
for 1bpp bmp

Is it intentional that policies employed by "ico" loader, "bmp" loader
and, e.g., GIMP are different in this respect?



-- 
Andrey Tsyvarev
 
 Linux Verification Center, ISPRAS
 web:    http://www.linuxtesting.org
 e-mail: tsyvarev ispras ru




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]