Optimizing Image Sizes
Posted: 2011-05-20T13:13:58-07:00
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.
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.