PNG compression?

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
norfstar

PNG compression?

Post by norfstar »

I've just moved a site from a shared hosting environment to a dedicated server, on which I have installed ImageMagick.

Unfortunately, the PNG images created on the new installation seem to have a much larger file size - what was 150KB on the previous server is now being produced at about 500KB.

The file is created using convert. The version of ImageMagick is 6.2.9. The version of libpng is 1.2.12. Can anyone suggest what needs to be done to be producing smaller file-sized PNGs as before?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

Add -strip to your command line to remove the image profiles. See if that reduces your PNG image size to something reasonable.
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: PNG compression?

Post by glennrp »

norfstar wrote: I've just moved a site from a shared hosting environment to a dedicated server, on which I have installed ImageMagick.

Unfortunately, the PNG images created on the new installation seem to have a much larger file size - what was 150KB on the previous server is now being produced at about 500KB.

The file is created using convert. The version of ImageMagick is 6.2.9. The version of libpng is 1.2.12. Can anyone suggest what needs to be done to be producing smaller file-sized PNGs as before?


Cqn you provide a sample image as converted on both systems? Give a URL or email them to glennrp at gmail.com
norfstar

Post by norfstar »

Thanks for the suggestion magick - unfortunately it doesn't seem to have had any effect.

Here are two example images:

http://www.nordev.co.uk/old.png (88k)

http://www.nordev.co.uk/new.png (285k)
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Post by glennrp »

"old.png" is 8-bit
"new.png" is 16-bit

Try using "-depth 8" option or installing the Q8 version of ImageMagick.

Glenn
norfstar

Post by norfstar »

glennrp wrote: Try using "-depth 8" option


Thanks Glenn - all is working as intended now :D.
Post Reply