I have portrait and landscape JPEG images.
I want to make square thumbnails with white background from all of them. I need to keep the aspect ratio of all images and reduce the larger border to 200px.
I want to use ImageMagick (CLI) but I don't know how to do that. Any idea ?
Here is the individual images :
To resize an image to specific dimensions, use the convert command with an input file, the -resize parameter, your preferred dimensions, and an output filename: convert original. png -resize 100x100 new. png.
The Constrain Proportions option lets you maintain the aspect ratio (the ratio of image width to image height). If you select this option and change the image size and resolution, the image does not stretch or shrink.
I think you need this:
convert -background white -gravity center \
input.jpg -resize 200x200 -extent 200x200 result.jpg
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With