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.

Use an array - Anthony 22/6/2008

Using an array to build the IM command.

  1. <?php
  2. $array = array('+23+67''+75+789 ''+76+297''+256+91');
  3. $cmd " \( -size 475x873 xc:black \) ".
  4. " \( cone.png -resize 30x30 \)  ".
  5. " \( -clone -colorize 40% \)  ".
  6. " \( -clone -colorize 20% \)  ".
  7. " \( -clone -colorize 90% \)  ";
  8. foreach ($array as $value) { 
  9. $cmd .= " \( -clone -repage ".$value." \) ";
  10. }
  11. $cmd .= " -delete 1-4 -compose screen -layers flatten ";
  12. exec("convert $cmd output.png");
  13. ?>

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