Assigning color resolution bits to gif

I parsed the gif image and here is the data in the header: ['G', 'I', 'F', '8', '9', 'a', '^', '\ x01', '^', '\ x01 ',' \ x87 ',' \ x00 ',' \ x00 ',' \ x00 ',' \ x00 ',' \ x00 ',' \ x01 ',' \ x00 ',' \ x00 ',' \ x01 ']

0x87 is a flag flag in gif. Convert this binary result to 0b10000111.

I am using http://www.matthewflickinger.com/lab/whatsinagif/bits_and_bytes.asp as a link.

So, according to this site, gif has (zero + 1) color resolution (2 possible colors, although the image has much more). I tried to edit this number and it did not change anything. Can anyone explain the purpose of the color resolution bits?

+6
source share
1 answer

you can edit it without harm, because you don’t need to decode the data - everything that it does describes the β€œsource” of the data (the last three bits in this byte refer to this particular image).

the standard itself http://www.w3.org/Graphics/GIF/spec-gif89a.txt (p. 9) says:

This value represents the size of the entire palette from which the colors in the graphic were selected, and not the number of colors actually used in the graphic.

and then adds:

This value should be set so as to indicate the richness of the original palette, even if not every color from the entire palette is available on the source computer.

so it seems that even the original authors did not have a big idea about how it will be used. and since it is not very useful, I believe that it is not correctly installed by some software.

[the only thing I see is that if this value was greater than the actual color depth, you could add a title / pop-up saying β€œthe original image was better than that.”]

+5
source

Source: https://habr.com/ru/post/895458/


All Articles