0

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

murb
  • 1,736
  • 21
  • 31
  • Works fine on v6.9.3. Are you on an old version? – Mark Setchell Feb 02 '16 at 17:37
  • By the way, 40 colours seems to *fall between two stools* - you probably get slightly better quality at no cost in terms of size, if you go to, say, 60 colours, – Mark Setchell Feb 02 '16 at 17:44
  • I'm seeing the blotchy letters with IM-6.9.0-0 but not with 6.9.3-1. The problem isn't in the PNG encoder because I see the same effect if I write to PPM (convert in.png -colors 40 -flatten out.ppm) – Glenn Randers-Pehrson Feb 02 '16 at 18:26
  • Thanks @MarkSetchell and @glen-randers-pehrson; it was a version issue. I tried the command both on a Linux machine and on a Mac, and typically my mac is more up to date so I thought it would be something different than a version problem. After a `brew update imagemagick` the thing worked :) – murb Feb 03 '16 at 12:19

1 Answers1

0

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.

murb
  • 1,736
  • 21
  • 31