Optimizing Image Sizes

Discuss digital image processing techniques and algorithms. We encourage its application to ImageMagick but you can discuss any software solutions here.
Post Reply
xfactor
Posts: 6
Joined: 2011-05-20T12:44:58-07:00
Authentication code: 8675308

Optimizing Image Sizes

Post 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.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Optimizing Image Sizes

Post by Bonzo »

Try -thumbnail as it strips everything except the colour profile: http://www.imagemagick.org/script/comma ... #thumbnail
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Optimizing Image Sizes

Post by fmw42 »

Anthony/Magick:

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.

Anthony:

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 http://www.imagemagick.org/Usage/formats/#profiles.

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
xfactor
Posts: 6
Joined: 2011-05-20T12:44:58-07:00
Authentication code: 8675308

Re: Optimizing Image Sizes

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