Snippets - Text

Snippets index page

NOTE: Most of the IM snippets have been tested on IM version 6.3.5 There may be some differences if you are using the code on other versions.

Watermark text and shadow - Anthony 15/6/2008

Adding text to an image with a "shadow"; annotate works better than draw.

  1. <?php  
  2. $cmd "input.jpg -font ../verdana.ttf -pointsize 30 ".
  3. " -gravity north -fill black ".
  4. " -annotate +0+12 \"Copyright of rubblewebs\" ".
  5. " -gravity north -fill white ".
  6. " -annotate +2+11 \"Copyright of rubblewebs\"  ";
  7. exec("convert $cmd output.png"); 
  8. ?> 

For more examples and information check out the main Imagemagick section.

Add a label View

Change font to Italic View

Fonts installed View

Fonts Installed view View

Label with image data View

Multiple text on an image View

Text made from an image on another image View

Watermark text and shadow View

Watermark tiled text View