Snippets - With php

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.

Batch file View

Check size before resizing View

Dividing an image View

Fonts Installed view View

Get image data into a variable 1 View

Get image data into a variable 2 View

Gravity option View

New image size in variable View

Row of images View

Setup Information View

Use an array View

Warhol effect View