Imagemagick: Convert to fixed width, proportional height

Imagemagick

Imagemagick Problem Overview


Using the imagemagick convert command, how can I resize an image to a fixed width and proportional height e.g. using the -resize or the -thumbnail option?

Imagemagick Solutions


Solution 1 - Imagemagick

Use -resize 100x to resize images to 100 pixels in width while maintaining the height's aspect ratio.

Read the fine ImageMagick manual for details.

Solution 2 - Imagemagick

Imagemagick geometry: 'width'x'height' If you leave one part empty, this means resize proportional.

Examples:

100x200       # width = 100, height = 200
300x          # width = 300, height = proportional
x300          # width = proportional, height = 300

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionChristof AenderlView Question on Stackoverflow
Solution 1 - ImagemagickmoropusView Answer on Stackoverflow
Solution 2 - ImagemagickChristof AenderlView Answer on Stackoverflow