I have been reading alot on how to remove the background colour from a .png image. I found some code on StackOverflow but I can't seem to get it to work. When the code is run the result is a blank screen. The aim is to remove the all the white background from the image.
Does anyone know how what is happening or is there a better way to make the image have a transparent background.
$image = imagecreatetruecolor("logo.png");
// Transparent Background
imagealphablending($image, false);
$transparency = imagecolorallocatealpha($image, 0, 0, 0, 127);
imagefill($image, 0, 0, $transparency);
imagesavealpha($image, true);
// Drawing over
//$black = imagecolorallocate($image, 0, 0, 0);
//imagefilledrectangle($image, 25, 25, 75, 75, $black);
header('Content-Type: image/png');
imagepng($image);