Search code examples
imagemagickpngalphaantialiasing

Imagemagick convert command adds noise to the png-to-png export result


I'm trying to convert an not-optimized PNG to an optimized version using ImageMagick's convert command:

convert -colors 40 test.png test-optimized.png

The problem is however that the convert operation adds weird noise. I want multiple levels of alpha transparency in my export, which convert seems to offer, but without all the noise, and the file size should stay low. I wouldn't expect to need more than 16 different colors to optimize the original image with some levels of anti-aliasing in both the blue area and the transparent area. Any idea's? It almost looks like it is adding something like a JPEG compression or something (which of course doesn't add transparency). I tried already with different -anti-aliasing and -alpha options.

Source

Source

Optimized

Result


Solution

  • This question can be closed: the problem was a version issue.

    The problem occurs with:

    • ImageMagick 6.9.0-0 (as reported by Mark Scetchell in the comments)
    • ImageMagick 6.9.1-0 Q16 x86_64 2015-04-06

    But no longer with:

    • ImageMagick 6.9.3-0 Q16 x86_64 2016-01-31

    Thanks to Mark Scetchel and Glenn Randers-Pehrson for their input.