How to resize product photos in batchs with Mogrify in two steps? The following requirement popped up to resize a batch of product photos with various resolutions.Final image size should be 500 x 500px.If the original image is larger it should be resized, for the aspect ratio.If the image width and height differ, the lower side should be filled with white background.The original image should be in the Center of the Final image.Most especially I am not a fan of wasting my time on repetitive works so AUTOMATION was the most important requirement:).I tried many options but the only stable solution I found was to use the Mogrify tool which comes with the ImageMagic package.I am using the Linux flavor because in two easy steps we are ready to roll.Step 1: Installing ImageMagickI am using Debian derivative OS for this example. If you have any other OS, please use the respective installation command.sudo apt-get updatesudo apt-get install ImageMagickStep 2: Resizing imagesUpload all of your photos to a folder in the Linux box and open that folder from the CLI.cd /image_foldermogrify -resize 500x500 -extent 500x500 -gravity center -background white *.jpgNote: In my situation, all images were in jpg format but if you have images in various formats please convert all of them to jpg before proceeding.That's it! :). Download your uploaded images and they should be in the required format by now.You can do many more things with this amazing tool. Please check the official documentation of Mogrify to learn more.Don't forget to leave a comment if this was helpful 😊 Posted byKanchana RandikaPosted atWednesday, January 25, 2017 Post a Comment Share Labels#Linux, #Other Kanchana Randika Kanchana Randika is currently a Lead Systems Engineer at a Dubai-based organization. He shares his knowledge and expertise with the community in his spare time. Newer Older Comments You are welcome to share your ideas with us in the comments!