How to resize product photos in batch (Center, White background with Aspect ratio)?

Today I had to resize large no of photos for an e-commerce website. Maybe it is the same reason why you read this article :).

Images were downloaded from the internet, therefore they were in various sizes varying from 650px to 5000px. Here are the requirements I had when I started this job.

  1. Final image size should be 500 x 500px.
  2. If the original image is larger it should be resized, with respect to the aspect ratio.
  3. If the image width and height differ, the lower side should be filled with white background.
  4. 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 solutions and finally found a convenient method that can address all of my above requirements. It was with the Mogrify tool comes with the ImageMagic package.

This is a Linux tool but it's very simple so please don't run away :).

Installing ImageMagick

I am using Debian derivative OS for this example. If you have any other OS, please use the respective installation command.
sudo apt-get update
sudo apt-get install imagemagick

Processing images

Note: 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.

Upload all of your photos to a folder in the Linux box and open that folder from the CLI.
cd /image_folder
mogrify -resize 500x500 -extent 500x500 -gravity center -background white *.jpg
That's it! :). Download your uploaded images and they should be in the required format by now.

You can do much more things with this amazing tool. Please check the official documentation of mogrify to learn more.

Hope this helped!


  1. Great blog post you have shared about Product Photo Editing Service according to it`s size and pixel.

  2. You may have put product photographs in your e-commerce site but you have observed that these photos are not attracting the clients. As a result, you product sell does not increase. Product Photography Editing

  3. So you've taken some great pictures and you want to share them with the world. The possibilities are endless; you can email them to friends or put them on your website, add to a document, upload to an online photo gallery or burn them to a slide show on disk. Thumbnail

  4. If you live in New York City or Los Angeles, you can pretty much get anything you want right there. However, you have the world to consider which is best product

  5. wow! pertandingan sabung ayam yang sangat seru dari sudut AGAW melawan BIYA untuk anda yang mau menonton silahkan akses link ini

  6. Your article provide us helpful information which help to editing product photo in perfect size and pixel.Thanks for sharing with us.
    Clipping Path service .
    E-commerce image editing service.

  7. Thanks for the blog, If you want to learn luminosity masks then adppro is the best site where you can learn about using luminosity masks.

  8. Beberapa Cara Untuk Menang Dengan Mudah Dalam Situs Judi Sabung Ayam Online Klik Di Sini

    Agen Sabung Ayam Online Terbaik Dan Juga Terpercaya

    Informasi Terlengkap Mengenai Sabung Ayam

  9. It is the fundamental background check approach of American Acme Corporation that predetermined current Staff workers with monetary administration obligation have their criminal and other background data confirmed as a state of proceeded with business.globenewswire

  10. This is the challenge for product photo. the size should be 500*500 and image should be attractive.clipping path can be the perfect solution.It will take a little bit more time but the product will get a new vision.