Skip to content

Optimize GIF size by using only the number of bits needed in LZW codes

Thomas Bernard requested to merge miniupnp/grafX2:gif_save into master

It was always storing images in 8bpp whatever the values of pixels are, so the minimum LZW code size was 9 bits.

Now the bpp is chosen according to the maximum pixel value.

Please note that the Whole 256 color palette is still stored entirely, so this commit doesn't change the user experience in anyway, except saving a few bytes :)

Merge request reports

Loading