Resize / crop and add 4 images

I am currently using this command to resize images using imagemagick:

convert \( ${files[0]} ${files[1]} -append \) \( ${files[2]} ${files[3]} -append \) +append $dir.jpg 

enter image description here

What is the best way to handle images of different sizes, as in the second picture? can I specify a specific width or height and make the image size and crop to this size if it is smaller, and crop the center if its really height, so I always get the result, as in the first image?

Thanks!

+6
source share
1 answer

Try resizing the image to the same size.

 for i in *.jpg; do convert $i -resize 80x80 -quality 90 $i.jpg; done 

Now you can add images.

Adding Images Before Resizing

enter image description here

Adding Images After Resizing

enter image description here

+4
source

All Articles