title: ImageMagick: how to minimally crop an image to a certain aspect ratio?
body: <p>With imagemagick, I'd like to crop an image, in a minimal fashion, so that it fits a given aspect ratio.</p>
  
  <p>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.</p>
  
  <p>So looking for a command looking something like <code>convert in.jpg -gravity center -crop_to_aspect_ratio 3:2 out.jpg</code>.</p>