Best command for resizing large pics for highest quality.

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
slogra

Re: Best command for resizing large pics for highest quality

Post by slogra » 2010-04-01T08:14:22-07:00

I don't think the jpeg compression of PS and IM should be different. You can do a little test by compressing the same picture (without resizing) to find out.

To get a smaller filesize you can play with the resize methods (less detail = smaller file) and the jpeg compression. I guess the IM resizing you used is just a more detailed and harder to compress than PS, so that would explain the filesize difference.

I'd say, try different resize methods, then check image details vs size. Then make a decision.

Personally i found that lanczos does give a bit ringing, which is ugly and probably increases filesize too, so i used Box filter instead (however i was working with cartoony images).

You can also use filters you remove details to bring down the filesize but i don't think you wanna go there.

Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: Best command for resizing large pics for highest quality

Post by Drarakel » 2010-04-07T18:43:40-07:00

The only degradation that I can see between the two pictures is due to color subsampling. The subsampling can distort some (red) parts (it often gets darker in that areas). In your case, Photoshop did create the image with a quality of around 99% and no subsampling (1x1). The Imagemagick pic was created with 100% and 2x1 subsampling. It's 'only' 2x1 - but that's still noticable (at some bits of the truck, the bike, the edges of the red camera, the red->green edges of the flowers, and some colors of that.. checkerboard).

@davidb2002: If it's the same thing that you noticed, I would advise that you use a fixed setting of 1x1. IMHO, the subsampling setting is more important than a high 'quality' setting (depends on the image of course). You could use a command like that:
convert input.jpg -resize 600x600 -quality 95 -sampling-factor 1x1 output.jpg
(You can also add the -strip option, but you could run into trouble if you have images that are not sRGB.)

Post Reply