Page 1 of 1

filesize/quality compared to photoshop

Posted: 2009-08-31T17:11:27-07:00
by sicnezz
hi all,

i'm using imagemagick to resize gallery images on my webserver and i always wondered that the images' filesizes were pretty high.

now here's what i did:

i loaded the original (big) image into photoshop, resized it to the same size, sharpened it, and tweaked the jpg quality at its best and saved it.
surprise: the photoshop file had better quality AND lower filesize (about 2-3 times) than the one from image-magick :(
i tried reducing jpg quality but when i had app. the same filesize as the photoshop image, the image's quality created by imagemagick was horrible.

here's my imagemagick command
rc = .Convert(m_src, "-resize=500x300,-sharpen=1,-quality=60, m_saveas)

is there a way to optimize jpg quality / filesize?

thanks
sic

Re: filesize/quality compared to photoshop

Posted: 2009-08-31T17:52:29-07:00
by fmw42
with regard to size, if you are on IM Q16, try adding -depth 8 to your command.

also I believe that photoshop includes some unsharp masking when resizing to compensate for poorer resampling filters than in IM. With IM you can pick from many resampling filters when reducing the image size. see http://www.imagemagick.org/Usage/resize/ and in particular see http://www.imagemagick.org/Usage/resize/#photoshop

also the quality level in IM is not likely to match exactly with the quality level in photoshop using the same numbers for quality

is there a way to optimize jpg quality / filesize?
None that I am aware of. They vary directly --- better quality means larger file size.

Also the result depend upon your jpg compression algorithm. What does photoshop use? who knows - it is proprietary? IM relies upon libjpeg (and whatever version you have compiled). So who knows how they compare?

Re: filesize/quality compared to photoshop

Posted: 2009-08-31T17:57:52-07:00
by magick
You can add -strip to the command line to strip any profiles or comment to reduce the image size.

Re: filesize/quality compared to photoshop

Posted: 2009-08-31T18:15:22-07:00
by sicnezz
magick wrote:You can add -strip to the command line to strip any profiles or comment to reduce the image size.
the -strip command helped! thanks :)
i'll also check out the filters.