Page 1 of 1

Asymetric border

Posted: 2017-04-04T12:57:59-07:00
by Flaver-D
Hi!
I'm trying to take a bunch of images, resize them to 425x283 and then add a black asymmetric border to them to make the final images 450x413 with the image in the center of the final image.

So far, using the Mogrify -thumbnails 425x283 does a good job getting them to size. But I really don't know how to get a border around them that's +25+130 ... Using the -border function won't work because it's symmetrical... unless I crop the image after... I really don't know

Thanks

Re: Asymetric border

Posted: 2017-04-04T13:00:40-07:00
by Bonzo
You could try adding -background white -gravity center -extent 450x413 to your command

You should be able to do it with the border command see: https://www.imagemagick.org/script/comm ... php#border

Re: Asymetric border

Posted: 2017-04-04T13:02:38-07:00
by fmw42
In addition to Bonzos suggestion (which is likely the best)

You can composite the image into a constant size black background with mogrify. See http://www.imagemagick.org/Usage/basics ... fy_compose. Probably use over rather than dst_in. See the -gravity to center.

Alternately, you can use multiple splice commands to add some amount to each of the four sides. See http://www.imagemagick.org/Usage/crop/#splice

Re: Asymetric border

Posted: 2017-04-04T13:08:54-07:00
by Flaver-D
Well... that was fast and easy!
Thanks a million.... somehow I just kept taking the hard route...

Now, I'm off to step two, putting them into a grid using the montage function :D