I'm currently using this command to resize images using imagemagick:
convert \( ${files[0]} ${files[1]} -append \) \( ${files[2]} ${files[3]} -append \) +append $dir.jpg
What is the best way to deal with images which dimensions differ like in the second picture? can I specify specific width or height and make the image resize and crop to that size if its smaller and crop the center if its really hight so I always get the result like in first picture?
Thanks!
Both require careful consideration as they can affect image quality. Resizing changes the dimensions of the image, which usually affects the file size (and, thereby, image quality). Cropping always involves cutting away part of the original image and results in some of the pixels being discarded.
Many editors provide settings for cropping to particular aspect ratios ““ the original ratio of the image, 3:2″¨4:3 and 16:9 being the most popular. The main factor to remember before you crop a digital image is that the pixels you discard cannot be restored.
In simple terms, cropping can be used to change the image ratio. It can also change the image size at the same time. Returning to our 10×8 print, we have two options to make the image fit on the paper. The first is to make the shortest dimension fit to the 8-inch width. 10×8 is an image ratio of 5:4.
You can crop to improve the way an image is framed by excluding unwanted elements that were inadvertently (or deliberately) included. Cropping out a branch that blew into the edge of the frame while you were taking the picture is an example. 4.
Try to resize the image to the same size.
for i in *.jpg; do convert $i -resize 80x80 -quality 90 $i.jpg; done
Now you can append images.
Appending images before resizing
Appending images after resizing
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