How to -draw text and -shadow it in ImageMagick?

Viewed 3687

I'm printing some text on an image with convert and I would like to decorate the text with a black shadow, I tried -blur or -gaussian but I cannot apply to the text, it is applied to the background image only. I need to use -draw command and not -annotate.

And this is the code I need to update for shadowing

-font "geometricslab703bt-bold-webfont.ttf" -fill White -pointsize 18 -draw "rotate -4 text 350,250 '---- mijn ideale ----'"

thanks in advance

2 Answers

You can use caption to draw text, and make a shadow layer with clone then merge the two layer.

convert logo: -resize 40%x40 \
    \( -size "80x40" -background none -gravity west  -fill green caption:"Caption text" \
    \( +clone -background navy -shadow 80x3+5+5  \) +swap -background none -layers merge +repage \) -composite \
    \( -size "80x40" -background none -gravity east  -fill green caption:"Caption text"  \
    \( +clone -background red -shadow 80x3+5+5  \) +swap -background none -layers merge +repage \) -composite \
    out.png

enter image description here

Related