I am using imagemagick
to add a border to an image.
I can add the border with the following code:
convert source.jpg -shave 10x10 -bordercolor red -border 2 final.jpg
The code above generates this image:
However, what i need to generate is something like this:
If you look at the red border in the second image, you would see the difference between that image and the first image which i currently create using imagemagick.
Could someone please advise on this?
Thanks in advance.
You do not say what version you are using or what code laungage either.
convert wizard: -stroke red -strokewidth 2 -fill transparent -draw "roundrectangle 10,10 470,627 10,10" output.png
If using version 7 you can calculate the dimensions within the command otherwise you need to get the dimensions of the image, do the calculations and input them into the command with a variable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With