Snippets - Watermark

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 tiled text - IM Forum 15/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.

  1. <?php  
  2. $cmd "-size 140x80 xc:none -fill grey -gravity NorthWest ".
  3. " -draw \"text 10,10 'Copyright'\" -gravity SouthEast ".
  4. " -draw \"text 5,15 'Copyright'\" miff:- | composite ".
  5. " -tile - input.jpg";
  6. exec("convert $cmd output.png"); 
  7. ?> 

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

Image watermark View

Multiple image watermarks View

Rotated transparent text View

Transparent text View

Watermark an animated gif View

Watermark text and shadow View

Watermark tiled text View