-colors does not work with RGBA PNG

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
Juce
Posts: 12
Joined: 2011-03-22T07:06:04-07:00
Authentication code: 8675308
Location: Finland

-colors does not work with RGBA PNG

Post by Juce » 2011-03-22T09:32:47-07:00

sphere.png:
Image

convert sphere.png -colors 50 spherecolors50.png
Image

convert sphere.png PNG8:spherepng8.png
Image

This works:
convert sphere.png spheregif.gif
Image

ImageMagick 6.6.8-6 2011-03-21 Q16
Windows XP 32-bit

User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: -colors does not work with RGBA PNG

Post by glennrp » 2011-03-22T10:58:14-07:00

For the first conversion I'm seeing the same result whether the output is .png or .txt so I don't think it's a PNG bug.

For the second conversion, it is to be expected that the quantization is lousy because we are simply dropping
the low 5 bits of the Red and Green samples and the low 6 bits of blue.

Converting spheregif.gif to spheregif.png looks pretty good, exactly the same as spheregif.gif but smaller file size.

Post Reply