Resize image, but keep proportion

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
brianez21
Posts: 4
Joined: 2007-01-13T10:50:36-07:00

Resize image, but keep proportion

Post by brianez21 »

How can I use the command line 'convert' tool to resize an image with a maximum size and keep proportion. For example: I have a 1024x768 image ("test.jpg") that I want to make a thumbnail of ("thumb-test.jpg"). I say the thumbnail can be (at most) 320x320. The resulting image should then have the size of 320x240. And same thing if the image was 768x1024 - to result in 240x320. Thanks in advance!
Last edited by brianez21 on 2013-06-18T09:04:50-07:00, edited 1 time in total.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

ImageMagick, by default, scales an image while maintaining the original aspect ratio of the image as you require.
brianez21
Posts: 4
Joined: 2007-01-13T10:50:36-07:00

Post by brianez21 »

Could you give me an example of how I would specify that on the command line?
Last edited by brianez21 on 2013-06-18T09:04:28-07:00, edited 2 times in total.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

See http://www.imagemagick.org/Usage/resize/ for examples on resizing an image.
brianez21
Posts: 4
Joined: 2007-01-13T10:50:36-07:00

Post by brianez21 »

Thanks
Post Reply