I have an image I'd like to put a white border around, covering the original image. However, unlike questions like this, I want to do it with a percentage of the image size. This means that -shave then -border doesn't work, as removing, say, 10% and adding it back results in a slightly smaller image (100 × 0.9 × 1.1 = 99)
So, my approach is to -clone the image, -shave it, set the original image to white and then compose it back together.
However, the only way I've been able to do this is with two clones (one to turn white and one to shave) and then -deleteing the original image before composing:
convert in.png -gravity center \
\( -clone 0 -evaluate set 100% \) \
\( -clone 0 -shave 10%x10% \) \
-delete 0 -composite out.png
This works, but I'm wondering if I can do it without the second -clone and the -delete 0. Something like the following (which doesn't work - the output is solid white):
convert in.png -gravity center \
\( -clone 0 -shave 10%x10% \) \
-evaluate set 100% -composite out.png


