ImageMagick - Resize to max width

Seems this is the way it is done, noting that width is the first parameter.

convert -resize '100' image.png

For anyone else wondering about height, then you would do this:

convert -resize 'x100' image.png

Source: http://www.imagemagick.org/script/command-line-processing.php

Edit (Nov 2014): Note that in the latest versions of ImageMagick you can no longer use quotes around the values as per Kevin Labécot's comment.


Your question is ambiguous. Your titles asks to resize an image to a max width, but then you seem to say you want to resize the image to a specific width.

If you want to resize something to a max width of 600px (ie, any image with a width of less than 600px will be unaffected), use:

convert original_image.jpg -resize 600x\> result_image.jpg

Or, to directly modify the original image:

mogrify  -resize 600x\> original_image.jpg

If you'd like max height rather than max width:

convert original_image.jpg -resize x600\> result_image.jpg