Awfully heavy PNGs from ImageMagick

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
pomle

Awfully heavy PNGs from ImageMagick

Post by pomle »

I'm using this command

"convert -size 1400x160 xc:transparent -gravity west -font "[dir]eighttrack.ttf" -pointsize 80 -fill "#000000" -stroke "#000000" -strokewidth 18 -draw "text 22,0 'pomletjorven'" \( +clone -background "#000000" -shadow 70x5+4+4 \) +swap -stroke "#f6f4f1" -strokewidth 20 -draw "text 25,-3 'pomletjorven'" -transparent "#f6f4f1" -stroke "rgba(255, 255, 255, 0.5)" -fill "#ffffff" -strokewidth 16 -draw "text 25,-3 'pomletjorven'" -stroke none -tile "[dir]text_fade_bright.png" -draw "text 25,-3 'pomletjorven'" \( -fill blue -draw "line 0,0 0,160" \) -trim -transparent blue -resize "550x40" -strip -quality 50 png: > "[dir]/text.png"

to create the following image: http://public.pomle.com/text_imagemagick.png

As you can see the resulting filesize is above 30 kiB for a rather small image. I opened it up and just resaved it to disk using PhotoShops Save for Web-dialog and the resulting PNG24 w/ transparency-filesize plummets down to a very decent 5.5 kiB. (example: http://public.pomle.com/text_photoshop.png).

Running the file through pngcrush almost halves the original 30 kiB and results in a 17 kiB file. How can PhotoShop be so superior att reducing this file in size?

Notice how the imagedata of both files seem to be identical.

Does anyone have any ideas of how I can improve compression?

Best regards,
Pontus
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Awfully heavy PNGs from ImageMagick

Post by fmw42 »

if you are on Q16 or higher IM, try adding -depth 8 to your command line
pomle

Re: Awfully heavy PNGs from ImageMagick

Post by pomle »

Thanks! That did the trick. I'll send you a gift cerificate for http://www.coolstuff.se/ when we release the new site! :)
Post Reply