Page 1 of 1

Why Gif palette is not fully used?

Posted: 2014-02-27T05:52:13-07:00
by Vielheit
I try to convert jpeg to a gif with the following command:

Code: Select all

convert test.jpg +dither test.gif
the number of the colors of the jpg: 18714
the numer of the gif colors are: 234

Gif supports 256 colors. So why are these 22 remaining colors (palette entries) are not used?

The differences to another tool which unfortunately does not support batch mode are visible. It uses the full table.

Thanks
Thomas

Re: Why Gif palette is not fully used?

Posted: 2014-02-27T06:46:07-07:00
by magick
Try this command:
  • convert test.jpg +dither -treedepth 8 -colors 256 test.gif

Re: Why Gif palette is not fully used?

Posted: 2014-03-01T18:33:51-07:00
by Vielheit
Unfortunately, no change. I tried different pics. The amount is newer 256, mostly in the range of 237 - 244.

Re: Why Gif palette is not fully used?

Posted: 2014-03-01T18:35:53-07:00
by magick
Post a URL to test.jpg so we can download and inspect it. We need to trace why the final colormap is less than 256 colors.

Re: Why Gif palette is not fully used?

Posted: 2014-03-01T18:45:52-07:00
by Vielheit
Image

Thanks for checking this,
Thomas

Re: Why Gif palette is not fully used?

Posted: 2014-03-01T19:11:09-07:00
by magick
The problem is an overly aggressive optimization to reduce the color reduction runtime. We'll get this fixed on the next point release of ImageMagick. Thanks.

Re: Why Gif palette is not fully used?

Posted: 2014-03-01T19:15:47-07:00
by Vielheit
That would be great! :D

Re: Why Gif palette is not fully used?

Posted: 2014-03-19T15:41:21-07:00
by Vielheit
I confirm the problem is solved with ImageMagick-6.8.8-8
Thank you very much!
Thomas