How to add inner border with some padding to an image using imagemagick?

Viewed 712

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:

enter image description here

However, what i need to generate is something like this:

enter image description here

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.

3 Answers
Related