Page 1 of 1

How to borders on the inside ?

Posted: 2019-03-18T21:11:43-07:00
by haloween
Hi guys and gals,

When i add borders to images, it places the border on the outside of the image thus increasing the images dimensions.

How can i add a border to the inside of the image, so that the image retains its previous dimensions but has a border overlayed around the edges of the image?

Cheers :)

Re: How to borders on the inside ?

Posted: 2019-03-18T21:27:24-07:00
by fmw42
Please always provide your Imageamgick version and platform when asking questions, since syntax may differ. Also provide your command line if possible.

The the way to do what you want is to shave off the amount of pixels that you want to add as a border. So if you only want one pixel border, then

Code: Select all

convert image -shave 1x1 -bordercolor somecolor -border 1 result

For new users, see

http://www.imagemagick.org/discourse-se ... f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
https://github.com/ImageMagick/usage-markdown
https://imagemagick.org/script/porting.php#cli