Back to the snippets index

Watermark text and shadow

( Anthony 16/6/2008 )

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

IM code:

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

Image to go with Watermark text and shadow example code