Page 1 of 1

Wrong palette when using convert -map

Posted: 2008-04-11T18:17:10-07:00
by naoliv
Hi!

From http://bugs.debian.org/466124 we are having this problem with newer ImageMagick releases.

Using these images:
http://people.debian.org/~naoliv/misc/i ... /image.png
http://people.debian.org/~naoliv/misc/i ... 4/cmap.gif

and running

Code: Select all

convert image.png +dither -map cmap.gif gif:- | convert gif:- output.png
With ImageMagick 6.2.4-5, we get this image:
http://people.debian.org/~naoliv/misc/i ... orrect.png

With newer versions (tested with 6.3.7-9 and 6.4.0-7 beta):
http://people.debian.org/~naoliv/misc/i ... -wrong.png

They may look similar, but see the difference in their color map (older version left, newer right):
ImageImage

Thank you!

Re: Wrong palette when using convert -map

Posted: 2008-04-12T07:22:00-07:00
by magick
The color reduction algorithm has been improved since the 6.2.4-5 release which can account for the difference you see. Using the compare utility we see a normalized MAE of 0.000191543 and the difference image suggests slight changes around the letter edges. Given these slight color difference, what makes the current algorithm "wrong".

Re: Wrong palette when using convert -map

Posted: 2008-04-13T15:20:13-07:00
by naoliv
Hum... right.
I see that in fact it isn't generating a "wrong" palette (it just changed the way of generating it). But is it a way to have the old one generated (or something similar), please?

Thank you!

Re: Wrong palette when using convert -map

Posted: 2008-04-13T15:29:12-07:00
by magick
Unless you can show that the current color reduction algorithm has a bug, our only suggestion would be to use an older version of ImageMagick to reproduce the original output image. Color reduction is a fuzzy process, meaning different algorithms can produce different results but still be correct in their behavior.