Wrong palette when using convert -map

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
naoliv
Posts: 110
Joined: 2007-12-10T18:54:27-07:00
Location: Brazil

Wrong palette when using convert -map

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

Re: Wrong palette when using convert -map

Post 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".
naoliv
Posts: 110
Joined: 2007-12-10T18:54:27-07:00
Location: Brazil

Re: Wrong palette when using convert -map

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

Re: Wrong palette when using convert -map

Post 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.
Post Reply