Reputation: 1626
I am currently doing the following to overlay a large image onto another:
$ convert orig.png overlay.png -gravity center -composite new.png
overlay.png is large and really just a semi-transparent texture.
But in some cases I'd like to have a 1 pixel sized margin around the overlay. So:
+--------------+
| +--------+ |
| | Overlay| |
| +--------+ |
+--------------+
Is this possible?
Upvotes: 4
Views: 1704
Reputation: 12375
Yes it is, for example you can add a border to overlay.png
image and then compose the result with orig.png
image.
To add a white 1px margin you can use these commands:
convert overlay.png -bordercolor White -border 1x1 overlay_border.png
convert orig.png overlay_border.png -gravity center -composite new.png
Upvotes: 4