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
filesize/quality compared to photoshop
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: filesize/quality compared to photoshop
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
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?
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
None that I am aware of. They vary directly --- better quality means larger file size.is there a way to optimize jpg quality / filesize?
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.
Re: filesize/quality compared to photoshop
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
the -strip command helped! thanksmagick wrote:You can add -strip to the command line to strip any profiles or comment to reduce the image size.
i'll also check out the filters.