//背景图片路径
$srcurl = '头像.jpeg';
//目标图片路径
$desurl = '透明国旗.png';
//创建源图的实例
$src = imagecreatefromstring(file_get_contents($srcurl));
//创建点的实例
$des = imagecreatefrompng($desurl);
//获取点图片的宽高
list($point_w, $point_h) = getimagesize($desurl);
list($point_w1, $point_h1) = getimagesize($srcurl);
imagecopyresampled($src, $des,0,0,0,0,$point_w1,$point_h1,$point_w,$point_h);
header('Content-Type: image/jpeg');
imagejpeg($src);
imagedestroy($src);
imagedestroy($des);
微信头像
< = = >
透明国旗⬇️
?