The command
imageconvert.exe in.jpg -resize 800x600 out.jpg
resizes the image so that it keeps original ratio, with maximum width of 800, and
I think you need the >
flag on the resize
. Let's create some images (one red 300x200, another blue 1000x500):
convert -size 300x200 xc:red small.png
convert -size 1000x500 xc:blue large.png
Now convert them both to 800x600 with no flags:
convert small.png -resize 800x600 a.png # 800x533
convert large.png -resize 800x600 b.png # 800x400
Now with flags:
convert small.png -resize 800x600\> a.png # 300x200
convert large.png -resize 800x600\> b.png # 800x400
You may need a caret (^
) rather than a backslash on Windows.
The various flags are explained in the documentation here. Thanks to @user1133275 for the suggestion.