using GD to change colors of an existing image

Mar 25, 11:46 AM

gd-php manual

very good example:
buttons!

php code to change a red to a sick green:
$image = imagecreatefrompng('red.png');
imagefilter($image, IMG_FILTER_COLORIZE, 0, 255, 0);
imagepng($image, 'green.png');
imagedestroy($image);
?>

examples from:
http://www.phpied.com/category/images/
http://www.myphpcave.com/image-manipulation/colorize-change-color-of-images-using-php-and-gd-library-php-5-version/

Mark Edwards

,

---

Commenting is closed for this article.

---