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

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
xrw

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

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

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

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

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

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