Page 1 of 1

Error in indexed PNG output if number of colors <= 16

Posted: 2008-08-20T13:12:56-07:00
by xrw
Conversion to an indexed PNG is erroneous if the number of colors in the input image is 1, 2, or 5 to 16, no matter if the input is indexed or not.

Example input

Code: Select all

~ $ convert in.png png8:out.png
Output

Code: Select all

~ $ convert -type palette in.png png8:out2.png
Output

Code: Select all

~ $ convert out2.png png8:out3.png
Output

Code: Select all

~ $ convert out3.png png8:out4.png
Output

Another example with a random image:

Input Image, output Image

This seems to be the same issue as for croco.png in this thread, but I opened a new thread because there was already confusion about 2 issues in 1 thread.

Code: Select all

~ $ convert -version
Version: ImageMagick 6.4.3 2008-08-20 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2008 ImageMagick Studio LLC

Re: Error in indexed PNG output if number of colors <= 16

Posted: 2008-08-20T15:48:06-07:00
by magick
We have a fix for the problem you reported in the Subversion trunk. It will also be available in the next point release.

Re: Error in indexed PNG output if number of colors <= 16

Posted: 2008-08-20T19:38:00-07:00
by xrw
I applied the patch from http://trac.imagemagick.org/changeset/11997 to 6.4.3-0 and it works for me now. Thanks for the quick fix!

BTW, this also seems to have fixed the bug with duplicate palette entries.