ImageMagick: how to minimally crop an image to a certain aspect ratio?
问题 With imagemagick, I'd like to crop an image, in a minimal fashion, so that it fits a given aspect ratio. Example: given an image of, say, 3038 x 2014 px, I want to crop it to have a 3:2 aspect ratio. The resulting image would then be 3021 x 2014 px, cropped from the, say, center of the original image. So looking for a command looking something like convert in.jpg -gravity center -crop_to_aspect_ratio 3:2 out.jpg . 回答1: 1. Specific target resolution If your goal at the end is to have a certain