Page 1 of 1

Re: Equally sized pictures with border

Posted: 2009-01-30T11:51:12-07:00
by fmw42
taghawi wrote:Hello,

I have a batch of different sized pictures. I would like to borders to all of them so that the images are the same size at the end.

Thanks

Davoud

If you want to add borders to them all, so that they are all bigger, but the same size, then figure out the largest size that you want them to be and use -extent. Here is an example that will make all the image 500x500 with a white border

convert inputimage -background white -gravity center -extent 500x500 outputimage

see

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

If you have images that are bigger than your final size, then you can shrink only those to that size or smaller and then add your border using -resize WIDTHxHEIGHT>

see

http://www.imagemagick.org/script/comma ... php#resize
http://www.imagemagick.org/script/comma ... p#geometry

So if you wanted it to have a minimum border of 10, then

convert inputimage -resize 490x490> -background white -gravity center -extent 500x500 outputimage

Re: Equally sized pictures with border

Posted: 2009-02-01T21:39:27-07:00
by anthony
For a general set of examples on this look at IM Examples, Thumbnails. Remember thumbnails are just small images, so what you do for them you can do for larger images too.

http://www.imagemagick.org/Usage/thumbnails/#pad