Page 1 of 1

How to do only northeast border?

Posted: 2009-02-19T21:53:49-07:00
by TualatriX
Hello all,

I want to write a drop shadow script, now I've drop the shadow successful.

Use the following command(it isn't written by me, I checkout from gscrot).

Code: Select all

convert "${FILE}" \( +clone -background gray -shadow 80x3+5+5 \) \
+swap -background none -mosaic +repage "${FILE}"
The question is, I want to do a alpha border in the northest, this command will apply the alpha border in all sides, but I only want to apply at northeast.

Code: Select all

convert -bordercolor 'rgba(255,255,255,0)' -border 10x10 test.png test_out.png
So how can I do it?

Re: How to do only northeast border?

Posted: 2009-02-19T22:05:57-07:00
by TualatriX
Oh, I got it:

Code: Select all

convert test.png -gravity northwest -background 'rgba(255,255,255,0)' -splice 20x20  test_out.png
:D

Re: How to do only northeast border?

Posted: 2009-02-23T21:29:13-07:00
by anthony
The PROPER solution is to NOT use -mosaic which only extends the virtual canvas right and downward, but clips images in the other direction.

Use instead -layers merge and follow with +repage to remove the image offset.

See IM examples, Shadow...
http://www.imagemagick.org/Usage/convolve/#shadow

which uses this technique, and goes to explain what is going one, as well as alternative solutions, such as what you discovered.