准备好深蓝色渐变的图片$imgstream = file_get_contents("深蓝色渐变的图片");
$dim = imagecreatefromstring($imgstream);$imgstream = file_get_contents("白色背景的jpg");
$sim = imagecreatefromstring($imgstream);$ind = imagecolorresolve($sim,255,255,255); //取得白色背景的索引
imagecolortransparent($sim,$ind); //定义成透明色imagecopyresized ($dim,$sim,0,0,0,0,.....); //叠加两图片imagejpeg($dim, "新的jpg");