I'm creating a website where user can edit images. For changing the colour of a png file, I use the following code.
$im = imagecreatefrompng ("image/white-round.png");
$index = imagecolorclosest ( $im, 255,255,255 );
imagecolorset($im,$index,0,0,255);
$imgname = "image/white-round.png";
imagepng($im,$imgname );
imagedestroy($im);
I'm getting $index
, but imagecolorset($im,$index,0,0,255);
is not working.