Why Gif palette is not fully used?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Vielheit
Posts: 5
Joined: 2014-02-27T05:42:18-07:00
Authentication code: 6789

Why Gif palette is not fully used?

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Why Gif palette is not fully used?

Post by magick »

Try this command:
  • convert test.jpg +dither -treedepth 8 -colors 256 test.gif
Vielheit
Posts: 5
Joined: 2014-02-27T05:42:18-07:00
Authentication code: 6789

Re: Why Gif palette is not fully used?

Post by Vielheit »

Unfortunately, no change. I tried different pics. The amount is newer 256, mostly in the range of 237 - 244.
Last edited by Vielheit on 2014-03-01T18:36:21-07:00, edited 1 time in total.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Why Gif palette is not fully used?

Post 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.
Vielheit
Posts: 5
Joined: 2014-02-27T05:42:18-07:00
Authentication code: 6789

Re: Why Gif palette is not fully used?

Post by Vielheit »

Image

Thanks for checking this,
Thomas
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Why Gif palette is not fully used?

Post 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.
Vielheit
Posts: 5
Joined: 2014-02-27T05:42:18-07:00
Authentication code: 6789

Re: Why Gif palette is not fully used?

Post by Vielheit »

That would be great! :D
Vielheit
Posts: 5
Joined: 2014-02-27T05:42:18-07:00
Authentication code: 6789

Re: Why Gif palette is not fully used?

Post by Vielheit »

I confirm the problem is solved with ImageMagick-6.8.8-8
Thank you very much!
Thomas
Post Reply