THESE CODES ARE PROVIDED FOR AN EXAMPLE OF HOW TO USE IMAGEMAGICK WITH PHP. CARE SHOULD BE TAKEN WHEN ACCEPTING USER INPUT.
I TAKE NO RESPONSABILTY FOR ANY PROBLEMS THAT MAY OCCURE WHEN USING ANY OF THIS CODE.
IT IS UP TO YOU TO SECURE THE CODE AND VALIDATE USER INPUT.
Draw an arc through 3 points.
$cmd = "-size 213x160 xc:NavajoWhite -stroke black ". "-strokewidth 1 -fill none -draw \"arc 66,50 200,150 0,135 \" "; exec("convert $cmd arc.jpg");
Drawer a circle with the center and start point.
$cmd = "-size 213x160 xc:NavajoWhite -stroke black ". "-strokewidth 1 -fill none -draw \"circle 106,80 106,10 \" "; exec("convert $cmd circle.jpg");
( Using -fill none draws the outline only. You can use -linewidth as well as -strokewidth. )
Draw a line between two points
$cmd = "-size 213x160 xc:NavajoWhite -stroke black ". "-strokewidth 1 -fill none -draw \"line 50,50 163,110 \" "; exec("convert $cmd line.jpg");
Draw a rectangle from two oposing corners
$cmd = "-size 213x160 xc:NavajoWhite -stroke black ". "-strokewidth 1 -fill none -draw \"rectangle 50,50 167,110 \" "; exec("convert $cmd rectangle.jpg");
Draw a rectangle with rounded corners
$cmd = "-size 213x160 xc:NavajoWhite -stroke black ". "-strokewidth 1 -fill none ". "-draw \"roundRectangle 50,50 167,110 10,10 \" "; exec("convert $cmd round_rectangle.jpg");
Draw text
$cmd = "$input -pointsize 40 -fill white ". "-gravity south -draw \" text 0,0 'Draw text' \" "; exec("convert $cmd text.jpg");