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.
// Create gradiant
exec("convert -size 460x65 gradient:red-yellow gradiant.png");
// Create the text to use as a mask
$cmd = " -size 460x65 xc:none -font $font1 -pointsize 60 ".
" -draw \"gravity center fill black text 0,0 \"Anthony\" \" ";
exec("convert $cmd text_mask.png");
// Lay the mask over the gradiant
$cmd = " -compose Dst_In text_mask.png -gravity center gradiant.png -matte ";
exec("composite $cmd text_gradiant.png");
// Delete tempory images
unlink("gradiant.png");
unlink("text_mask.png");