Snippets - Create

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.

Draw concentric circles - Anthony 14/6/2008

This code shows how to draw concentric circles.

  1. <?php 
  2. $cmd "-size 200x200 xc:black -stroke black -strokewidth 1"
  3. " -fill white -draw \"circle 100,100 100,10 \" "
  4. " -fill black -draw \"circle 100,100 100,30 \" ".  
  5. " -fill blue -draw \"circle 100,100 100,50 \" ".  
  6. " -fill red -draw \"circle 100,100 100,70 \" ".  
  7. " -fill yellow -draw \"circle 100,100 100,90 \" ".  
  8. " -fill none -draw \"circle 100,100 100,20 \" "
  9. " -fill none -draw \"circle 100,100 100,60 \" "
  10. " -fill none -draw \"circle 100,100 100,80 \" ".  
  11. " -fill none -draw \"circle 100,100 100,95 \" ".  
  12. " -stroke white -fill none  ".  
  13. " -draw \"circle 100,100 100,40 \" ";  
  14. exec("convert $cmd output.png"); 
  15. ?>

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

Draw concentric circles View

Draw polyline View

Draw rectangle View

Draw using ellipse View