Changing aspect ratio

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
tbmuc
Posts: 1
Joined: 2016-02-02T12:52:09-07:00
Authentication code: 1151

Changing aspect ratio

Post by tbmuc »

Hello,

I am new to Imagemagick and I tried to convert a 1600x2500 pixel image to 412x547 which differs in the aspect ratio.

After using
convert %1.jpg -resize 412x547 %1_tmp.png

the result has the 342x547. How to get the right resoloution?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Changing aspect ratio

Post by fmw42 »

You have a choice. You can squish the image to get exactly what you want, but the image will be distorted. You can pad it to the right aspect or you can crop it to the right aspect. See the ! symbol for squishing it to preserve the aspect at http://www.imagemagick.org/script/comma ... p#geometry.

Also see crop and pad at:

http://www.imagemagick.org/Usage/thumbnails/#pad
http://www.imagemagick.org/Usage/thumbnails/#cut
Post Reply