Optimizing alpha PNGs

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
allidid

Optimizing alpha PNGs

Post 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!
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Optimizing alpha PNGs

Post by magick »

Try adding -depth 8 to your command-line.
allidid

Re: Optimizing alpha PNGs

Post 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
Post Reply