Page 1 of 1

Shadow of caption AND image blured

Posted: 2018-03-05T09:15:59-07:00
by TerraD
Hi

I'm all new to ImageMagick and due to my mothertongue some details are pretty hard to understand. Unluckily most samples have a monchrome background, while I need a .jpg

After some trial an error I almost got what I want:

Code: Select all

convert myImage.jpg -font Calibri -pointsize 48 -gravity south -stroke black -strokewidth 2 -annotate +5+5 "myImage" -blur 0x4 -stroke black -strokewidth 1 -fill white -annotate +0+10 "myImage" myImage.png
Most of this was taken from the 'Fuzzy Shadow' sample. However in the sample is just a lightblue background... no matter if that blurs!

But: I don't want the original picture myImage.jpg to be blured, only the caption should have a shadow to be better readable.

I failed trying to make this work with -shadow...

Re: Shadow of caption AND image blured

Posted: 2018-03-05T11:19:49-07:00
by fmw42
You need to create a new text image, blur it, then overlay it on your image. For example (unix syntax):


Image

Code: Select all

convert lena.jpg \
\( -size 200x -background none -font ubuntu -fill black label:TESTING -blur 0x3 \) \
-gravity center -compose over -composite \
result.jpg
Image

See
https://www.imagemagick.org/Usage/text/

If on Windows do not escape the parentheses and change the end of line \ to ^

If you want multi-line text, then use caption: rather than label:. Or create a text only image on transparent background writing the text with -annotate or -draw. Then composite it over your background image.

Re: Shadow of caption AND image blured

Posted: 2018-03-06T02:41:51-07:00
by TerraD
Thank you for this input. I'm not yet where I want to be, but you gave me input in which direction to continue...

I skipped through your ImageMagick Scripts and was impressed by the possibilities! GREAT work, thank you for this inspiration!