Page 1 of 1

Optimizing alpha PNGs

Posted: 2008-02-05T09:09:54-07:00
by allidid
This is the command I'm currently running...

Code: Select all

convert test.jpg -quality 90 -format PNG32 -background transparent -thumbnail x330 -resize '440x<' -resize 50% -gravity center -crop 220x165+0+0 -rotate "-4.4" test.png
As you can see, it resizes, crops and rotates a JPG image and outputs it as an alpha PNG (transparent background). This command is currently outputting PNGs with file sizes of around 240KB, which is a lot larger than I'd ideally like.

Having looked into formats and optimization with ImageMagick on this page http://www.imagemagick.org/Usage/thumbnails/ I am no clearer as to how I can reduce the file size of the outputted alpha PNG. I am aware of tools such as pngquant, but ideally I'd like to do more optimization within ImageMagick.

Any tips and tricks are greatly appreciated, thanks!

Re: Optimizing alpha PNGs

Posted: 2008-02-05T09:53:19-07:00
by magick
Try adding -depth 8 to your command-line.

Re: Optimizing alpha PNGs

Posted: 2008-02-05T10:13:57-07:00
by allidid
magick wrote:Try adding -depth 8 to your command-line.
Great, thanks a lot for that - did the trick! I got an image that was previously 218.76 KB to output at a mere 68.83 KB :D