I need to scale some gif images at work and then go to Imagecopymerge, but I found out after using imagecreatetruecolor and imagecopyresampled The background image is wrong. The originally transparent background image turned into black. Later I found that some modifications can be done:
3 45 |
$img = imagecreatetruecolor(200, 200);
//2. Coloring
$color=imagecolorallocate($img,255,255,255);
//3. Set transparency
imagecolortransparent($img,$color);
imagefill($img,0,0,$color);
|