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.
// Get the size of the image to create a gradiant that will cover it
$size = getimagesize('House.jpg');
// Creat the gradiant and add it to the image - I moved the gradiant up 50px as the sky was to black
$cmd = " -size {$size[0]}x{$size[1]} gradient:black-none ".
" House.jpg +swap -gravity south -geometry +0+50 -composite ";
exec("convert $cmd gradiant_house.jpg");