Hi.
Is there a quick way to add an inner border to an image? I have been using -border, but as expected it adds the border outside of the image creating a larger image.
Any help is appreciated.
Inner border
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Inner border
You can shave pixels from the edges before adding the border. See http://www.imagemagick.org/script/comma ... .php#shave
snibgo's IM pages: im.snibgo.com
Re: Inner border
Just what I was looking for. Thank you!
- GeeMack
- Posts: 718
- Joined: 2015-12-01T22:09:46-07:00
- Authentication code: 1151
- Location: Central Illinois, USA
Re: Inner border
Yep, as snibgo mentioned, you can shave off a given amount of the image, then add a border of that same amount. In its simplest form, to get an inner border of 6 pixels for example, you could put something like this into your command...
Code: Select all
... -shave 6 -border 6 ...
Re: Inner border
Yup nice and simple. Works.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Inner border
It is simple, and quick to write. It probably isn't the quickest to execute. It may be quicker to draw four rectangles of the required size, one per edge, especially if the image is large but the border is thin.
snibgo's IM pages: im.snibgo.com