Downsample JPEG to 72x72

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?".
Post Reply
wingo
Posts: 2
Joined: 2013-04-10T14:59:43-07:00
Authentication code: 6789

Downsample JPEG to 72x72

Post by wingo »

Hello Everyone,

I am hoping someone might be able to help me out. I am trying to use ImageMagick to convert an image that is 1400x900 with a resolution of 254x254. i am trying to get it to a size of 1100x600 with a resolution of 72x72. I have tried to use -resize -resample with the quality arg. I don't seem to be able to get it done. I have tried my suggestions from the web, but none so far have worked out. Anyone have an command line that might work for this. Running on Mountain Lion.

Thanks Bob.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Downsample JPEG to 72x72

Post by snibgo »

This should do the job:

Code: Select all

convert in.jpg -resize 1100x600! -density 72 out.jpg
snibgo's IM pages: im.snibgo.com
wingo
Posts: 2
Joined: 2013-04-10T14:59:43-07:00
Authentication code: 6789

Re: Downsample JPEG to 72x72

Post by wingo »

Thanks, that did the trick for the resolution! Not sure how I missed that one.
henrywho
Posts: 188
Joined: 2011-08-17T06:46:40-07:00
Authentication code: 8675308

Re: Downsample JPEG to 72x72

Post by henrywho »

Depending on the image content, you may also want to refer to the resize algorithms and the gamma issues mentioned in:

http://www.imagemagick.org/Usage/filter ... downsample

For example:

Code: Select all

convert in.jpg -colorspace RGB -filter LanczosRadius           -distort Resize 1100x600! -density 72 -colorspace sRGB out.jpg
convert in.jpg -colorspace RGB -filter LanczosSharp            -distort Resize 1100x600! -density 72 -colorspace sRGB out.jpg
convert in.jpg -colorspace RGB -define filter:window=Quadratic -distort Resize 1100x600! -density 72 -colorspace sRGB out.jpg
Post Reply