filesize/quality compared to photoshop

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
sicnezz

filesize/quality compared to photoshop

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: filesize/quality compared to photoshop

Post 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?
Last edited by fmw42 on 2009-08-31T18:07:15-07:00, edited 2 times in total.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: filesize/quality compared to photoshop

Post by magick »

You can add -strip to the command line to strip any profiles or comment to reduce the image size.
sicnezz

Re: filesize/quality compared to photoshop

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