Back to the snippets index

Watermark tiled text

( IM Forum 16/6/2008 )

This uses the imagemagick miff which saves the image into the memory and then the Unix "pipe". This uses the image created in the first part of the code in the second part of the code. Note the extra - between -tile and the image name; without it the code will fail.

IM code:

"-size 140x80 xc:none -fill grey -gravity NorthWest ".
" -draw \"text 10,10 'Copyright'\" -gravity SouthEast ".
" -draw \"text 5,15 'Copyright'\" miff:- | composite ".
" -tile - input.jpg";
exec("convert $cmd output.png"); 

Image to go with Watermark tiled text example code