Text Handling


Table of Contents

Annotating Images 
pure text 
annotating text onto images 
ImageMagick Text Handling 
help 
Examples 
Compound Font Effects 
Creating the glowing effect 
Imprinting date to digital photos 
Imprinting date to digital photos 

Annotating Images 

pure text 

Hard Shadow
http://www.imagemagick.org/Usage/fonts/#hard_shadow
Drawing the font twice with an offset, you can make a simple 'hard' shadow effect.

convert -size 320x100 xc:lightblue -font Candice -pointsize 72 \
        -fill black -draw "text 28,68 'Anthony'" \
        -fill white -draw "text 25,65 'Anthony'" \
        font_shadow.jpg

font_shadow.jpg

convert -size 320x100 xc:lightblue -font Candice -pointsize 72 \
        -fill black -annotate +28+68 'Anthony' \
        -fill white -annotate +25+65 'Anthony' \
        font_shadow1.jpg

Same effect.

convert -size 320x100 xc:lightblue -font Candice -pointsize 72 \
        -stroke black -strokewidth 8 -annotate +25+65 'Anthony' -blur 0x8 \
        -fill white   -stroke none   -annotate +25+65 'Anthony' \
        font_denser_soft_outline.jpg

font_denser_soft_outline.jpg

annotating text onto images 

Outined Label

The simplist method is to draw the string with a outline to seperate the text from the image. However as the "-stroke" font setting adds thickness to a font both inward and outward, it is a good idea to draw the text twice.

convert logo: -gravity south \
        -stroke '#000C' -strokewidth 2 -annotate 0 'Faerie Dragon' \
        -stroke  none   -fill white    -annotate 0 'Faerie Dragon' \
        anno_outline.jpg

anno_outline.jpg

Image Fancy Label

As a final example I will overlay a text string created using a fancy soft outlined font to make sure it remains visible, but without creating a rectangular box for the annotation.

convert -size 100x25 xc:none -gravity center \
        -stroke black -strokewidth 2 -annotate 0 'Faerie Dragon' \
        -channel RGBA -blur 0x3 \
        -stroke none -fill white     -annotate 0 'Faerie Dragon' \
        +size  logo:  +swap \
        -gravity south -geometry +0-2  -composite  anno_fancy.jpg

anno_fancy.jpg

Steps decomposition:

convert -size 100x25 xc:transparent -gravity center \
        -stroke black -strokewidth 2 -annotate 0 'Faerie Dragon' \
        -channel RGBA -blur 0x3 \
        -stroke none -fill white     -annotate 0 'Faerie Dragon' \
        anno_fancy.step1.jpg
convert anno_fancy.step1.jpg +size plasma:  +swap \
        -gravity south -geometry +0-2  -composite  anno_fancy.step2.jpg