$im = imagecreatefromgif('heart.gif');
/* R, G, B, so 0, 255, 0 is green */
imagefilter($im, IMG_FILTER_COLORIZE, 0, 255, 0);
header('Content-type: image/gif');
imagegif($im);
imagedestroy($im);
?>
See original image:
Heart