magick $filein -resize 1280x720 -background black -gravity center -extent 1280x720 $fileoutThis first resizes the image to a size that will fit into 1280x720. Then puts it on a black background that's 1280x720.
Programming Tips - ImageMagick: resize a series of images with different aspect ratios to the same size with letter boxing
Date: 2016apr26
Update: 2024dec31
Product: ImageMagick
Q. ImageMagick: resize a series of images with different aspect ratios to the same size with letter boxing
A. Assuming you are going to 1280x720, for each file do: