Resize to 800x600 or 600x800 (conditional resize)
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
If you know the image has a 4:3 or a 3:4 aspect ratio... then just resize the image to the larger size and the other will be automatically handled.
EG: -resize 800x800
will do what you asked. It will fit the image into that sized box and adjust the dimensions to preserve the aspect ratio.
If you have no control of your images aspect ratio, then you will need to define exactly what you want done EG if you are given a 1024x20 image (a section seperator 'line' for a web page, what do you want as a result.
Basically the solution depends on how much control you have on the input images.
For more see IM Examples Resize
http://www.cit.gu.edu.au/~anthony/graph ... k6/resize/
and more specific (and smaller scale) examples
http://www.cit.gu.edu.au/~anthony/graph ... humbnails/
EG: -resize 800x800
will do what you asked. It will fit the image into that sized box and adjust the dimensions to preserve the aspect ratio.
If you have no control of your images aspect ratio, then you will need to define exactly what you want done EG if you are given a 1024x20 image (a section seperator 'line' for a web page, what do you want as a result.
Basically the solution depends on how much control you have on the input images.
For more see IM Examples Resize
http://www.cit.gu.edu.au/~anthony/graph ... k6/resize/
and more specific (and smaller scale) examples
http://www.cit.gu.edu.au/~anthony/graph ... humbnails/
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
You are most welcome.
Often the default action of IM is just what you need, if you just allow it to do its job
Often the default action of IM is just what you need, if you just allow it to do its job
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/