imagefill() turns rest of the area black
- by Nidhinzz Own
I'm using imagefill() for changing the background color if an image.But while doing so the other areas which are not to be affected, change its color to black.
$image = imagecreatefrompng("sample.png");
$background = imagecolorallocate($image, 255, 0,0);
imagefill($image, 0,0, $background);
header("content-type: image/png");
imagepng($image,"sample.png");
This is my code.Can anyone tell me how this is happening ?