Batch Image processor that adds white space

1.8k Views Asked by At

I'm looking for a way to ADD in white space to images so that they fit an exact dimension. I have product images of all shapes and sizes and I need every image to be exactly 100px x 200px.

This is not for our site, but rather for a vendor's site. Their requirements.

So, I can batch them to fit within that container, but I haven't found software to add in whitespace.

e.g.

  • Image1 = 100 x 80
  • Image2 = 80 x 200

For image 1, I want to add 120px of blank space to the bottom. For image 2, I want to add 10px of space to the left and right.

What tool can I use to automate this for 400 products?

1

There are 1 best solutions below

0
On

ImageMagick can be used for this task:

http://www.imagemagick.org/Usage/crop/#border

If multiple images are concerned, mogrify is the command (same flags as convert in the example, yet mogrify accepts multiple images as its input).