Page 1 of 1

New to Imagemagick

Posted: 2012-07-17T14:04:27-07:00
by GoldenGonaz
Hello all,

I am new to imagemagick and have a question or two. I'd really appreciate if anyone could lend some advice...

I have imagemagick on my server, I do not know if it is Q8 or Q16 - I only heard about these today, as far as i was aware it was just imagemagick.

I am trying to compress some png images so they save as png-8 (not png 24, I want smaller more compressed files). I was advised by someone that I may need to install imagemagick Q8 instead of Q16. Would that be correct advise, would it mean images made as a result of imagemagick Q8 were smaller file size (and less quality)?

Also if I wanted to install imagemagick q8, how would I go about that. I have a FreeBSD server...

Thanks for any help, as I said it's really appreciated as this is really quite lost on me.

Re: New to Imagemagick

Posted: 2012-07-17T15:54:49-07:00
by fmw42
You do not need to install Q8, the default Q16 will work fine.

You can find out what version of IM by typing

convert -version

and the reply will be something like

Version: ImageMagick 6.7.8-2 2012-07-08 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features:

To compress your png, do the following:
(this assumes your png has no transparency. if so then if it is 8-bit transparency, converting palette via PNG8: will make the transparency binary)

convert image.png -depth 8 PNG8:result.png

If this does not work, try either

convert image.png -depth 8 -type palette PNG8:result.png
or
convert image.png -depth 8 -type palette result.png

If transparency in your image, then use -type palettematte.

see
http://www.imagemagick.org/script/comma ... .php#depth
http://www.imagemagick.org/Usage/formats/#png
http://www.imagemagick.org/Usage/formats/#png_formats

Re: New to Imagemagick

Posted: 2012-07-17T17:23:48-07:00
by glennrp
You can just do

Code: Select all

convert in.png png8:out.png
You don't actually need either -type or -depth; the PNG8 sub-format sets those for you.
You might want to strip out unnecessary ancillary PNG chunks, which the "-strip" option will do for you:

Code: Select all

convert in.png -strip png8:out.png
fmw42 is correct, you can use either Q8 or Q16 for this.

Re: New to Imagemagick

Posted: 2012-07-23T11:11:45-07:00
by GoldenGonaz
Thanks guys, some of this really helped :D