Imagemagick: Convert to fixed height, proportional width

Christian picture Christian · Jun 7, 2011 · Viewed 19.6k times · Source

Using Imagemagick, I'd like to convert a batch of PNGs to a fixed height of 1080px and a proportional width. With proportional I mean this: If the original Image is scaled down 16.8% to 1080px, the width also needs to be scaled down by 16.8%.

Any way of using convert without having to calculate the exact geometry before (using identify and some bash calculation shenanigans) ?

Answer

Dmitri Gudkov picture Dmitri Gudkov · Jun 7, 2011

Try this:

convert -resize x1080 {from_path} {to_path}