How to resize an image in imagemagick but keep an aspect ratio constant
问题 I am trying to resize an image (using imagemagick) to keep it's current aspect ratio but fit it into a 4/3 container. This is the command I have so far: magick convert ./horse.jpeg -background white -gravity center -extent 4/3 ./hourse_output.jpeg This is what I'd like: . As you can see, the image is "put into" a 4/3 container. 回答1: My error. The aspect ratios such as 4:3 in ImageMagick -extent will only crop and not pad. See my bash unix script "aspectpad" at http://www.fmwconcepts.com