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
borders on the inside
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Draw, a rectangle with the right stroke width around your image.
Hmmm a rose is 70x46 pixels, so...
the stroke width = {border width wanted} * 2 -1
EG: 1 -> stroke width of 1
6 -> stroke width of 11 (as above)
I have no idea where this should be put in IM Examples!!!!
Hmmm a rose is 70x46 pixels, so...
Code: Select all
convert rose: -fill none -stroke navy -strokewidth 11 \
-draw 'rectangle 0,0 69,45' inside_border.jpg
EG: 1 -> stroke width of 1
6 -> stroke width of 11 (as above)
I have no idea where this should be put in IM Examples!!!!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Then you will have you use -chop and -slice.. on the edges with gravity settings
Once on diagonally oppist corners will do the trick.
Addes to IM Examples misc -- will appear in a few hours there
Once on diagonally oppist corners will do the trick.
Code: Select all
convert rose: -background green -chop 6x6+0+0 -splice 6x6+0+0 \
-gravity SouthEast -chop 6x6+0+0 -splice 6x6+0+0 \
+gravity inside_border_spliced.jpg
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/