$c = 'johnny-bravo.png'; //transparent bg
$imagesize = getimagesize($c);
$background = imagecreatefrompng('background.png'); //background
$char = imagecreatefrompng($c);
imagealphablending($char, false);
imagesavealpha($char, true);
imagecopymerge($background, $char, 260, 17, 0, 0, $imagesize[0], $imagesize[1], 100);
header('Content-type: image/png');
imagepng($background);
imagedestroy($background);
输出:
http://i.stack.imgur.com/0E7Lz.png
如何为“johnny-bravo”制作透明背景?