Page 1 of 1

Optimizing Image Sizes

Posted: 2011-05-20T13:13:58-07:00
by xfactor
I am developing a script using the ImageMagick COM+ component to process images in a production web environment. We currently use a legacy process that utilizes the Photoshop COM + interface, so this new script will be replacing that process.

By way of disclaimer, I am not a graphics expert, so I apologize if some of this seems a little basic. Everything has gone smoothly so far, but I am unable to get image sizes anywhere close to the size that photoshop turns them out with equivalent quality.

I am using the convert process to resize large images down to various sizes based on site config (Typical sizes are 500x500, 350x350, 135x135 and 60x60). Each image gets resized to all those sizes, then it gets optimized for web based viewing.

I am currently using Convert instead of Mogrify since I need separate output images.

The options I am using now are:

For the Resize Function: "-resize", xxx, "-sharpen", "0", "-colorspace", "RGB", "-flatten"

For the Optimize Function: "-quality", "75"

If I add the "-strip" function to the optimize routine, it brings the image sizes down to about the same size that photoshop creates, but the image colors and quality are horrible. Without it, the quality is fine but the size is at least double those that Photoshop is turning out. I can't turn the compression down any more because they get too grainy under 75%.

Any ideas on how to maintain quality on multiple image sizes while bringing the size down? If Photoshop can do it, I'm sure ImageMagick can do it better with the right settings.

Any ideas or suggestions are appreciated.

Re: Optimizing Image Sizes

Posted: 2011-05-20T13:22:28-07:00
by Bonzo
Try -thumbnail as it strips everything except the colour profile: ... #thumbnail

Re: Optimizing Image Sizes

Posted: 2011-05-20T14:16:54-07:00
by fmw42

This probably should be moved to the User's forum as it has to do directly with IM processing and not a general non-IM image processing topic.


Perhaps you should mark your recent post as READ THIS FIRST as you did in the Users forum.

@xfactor try -unsharp or -adaptive-sharpen rather than sharpen

What type/format input and output image? What colorspace is your input image? If cmyk, then you are better off using -profiles (to match the cmyk in your image) and sRGB.icc for the output rather than converting it using -colorspace. Or strip everything and use two standard cmyk and sRGB profiles. See

I may be wrong on this, but I believe that PS has its own proprietary jpg compression and IM uses a delegate library, libjpg, to do such. So PS may be able to do a better job.

Also what version of IM ?

As a new member, please read viewtopic.php?f=22&t=18778 and viewtopic.php?f=1&t=9620

Re: Optimizing Image Sizes

Posted: 2011-05-20T14:58:11-07:00
by xfactor
Thanks for the input.

By replacing -resize with -thumbnail and -sharpen, "0" with -adaptive-sharpen, "0" I was able to bring the size down by almost 50% while maintaining quality.

I am now getting smaller image sizes than Photoshop puts out, with equivalent or better quality.

I realize now that I posted this under the wrong forum, so feel free to move it where ever is most appropriate.

Thanks again for the helpful suggestions, I really appreciate it.