0

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.

4

1 回答 1

1

imagecolorset() doesn't work for me.

But imagefill() works fine for me.

Refer http://www.tuxradar.com/practicalphp/11/2/8

于 2012-11-03T17:21:41.800 回答