Problem with gd library's function imageColorSet()
Posted: Mon Apr 18, 2011 3:16 am
Hello everyone,
I am currently working on a project and I would like to be able to replace colors by other in
some pictures.
I used the following code but it just does nothing, and I have no clue why. What do I get wrong ?
I also uploaded the picture I am trying to modify.
Thanks for reading.
I am currently working on a project and I would like to be able to replace colors by other in
some pictures.
I used the following code but it just does nothing, and I have no clue why. What do I get wrong ?
Code: Select all
$imgPath = "pictures/basic.png";
$myPicture = imageCreateFromPng($imgPath);
$index = imageColorat($myPicture, 5, 5);
imagecolorset ($myPicture, $index, 255, 0, 0);
imagepng($myPicture, $imgPath);I also uploaded the picture I am trying to modify.
Thanks for reading.