1

I want to resize some PNG images with imagemagick, but it's making the files 5 times larger when I convert them:

$ convert -resize 50% -quality 80 01.png 01_half.png
$ ls -hal 01*.*
-rw-rw-r-- 1 3.3M Sep  9 09:05 01_half.png
-rwxr-xr-x 1 651K Jan 13  2011 01.png

From 651KB to 3.3MB! Can anyone suggest how to stop this happening?

Richard
  • 31,629
  • 29
  • 108
  • 145

1 Answers1

1

Please note that ImageMagick's quality option's behavior is different with PNG's than it is with eg JPG's, and 80 looks like a pretty odd value for PNG's. As explained in the manual quality's value is cut in 2 where the first digit controls the zlib compression factor, and the second digit controls the filter type.

fvu
  • 32,488
  • 6
  • 61
  • 79
  • Just tried without the `-quality` option, and it resizes it to 3.7MB. – Richard Sep 09 '11 at 14:26
  • @richard weird... check http://www.imagemagick.org/Usage/formats/#png_quality for extra info regarding png compression. – fvu Sep 09 '11 at 14:34
  • Thanks for the link! Am trying `quality 02` etc but not getting anywhere. Maybe I need OptiPNG. – Richard Sep 09 '11 at 14:49
  • @richard fixing the first digit to 9 (for max. compression) won't hurt I think. But you may be right. – fvu Sep 09 '11 at 15:07
  • I ended up doing batch process in IrfanView on a Windows machine :-/ – Richard Sep 14 '11 at 12:38