I use this code to create an image from another png image, the default color is black. My question is how to set a transparent background?
$input = imagecreatefrompng('image.png'); $output = imagecreatetruecolor(50, 50); imagecopy($output, $input, 4,0, 8,8, 8,8); imagecopy... etc. header('Content-Type: image/png'); imagepng($output);
Is there an easy way to do this? Thanks
2by
source share