画像に透かしを付ける


/**
 *          
 */
/**/
//    
$path1 = "images/bd.png";
$path2 = 'images/code.png';
//    
$info1 = getimagesize($path1);
$info2 = getimagesize($path2);
$type1 = image_type_to_extension($info1[2],false);
$type2 = image_type_to_extension($info2[2],false);
$fun1 = "imagecreatefrom".$type1;
$fun2 = "imagecreatefrom".$type2;
$image1 = $fun1($path1);
$image2 = $fun2($path2);
/**/
imagecopymerge($image1,$image2,20,20,0,0,$info2[0],$info2[1],50);
header("Content-type:".$type1);
imagepng($image1);
/**/
imagedestroy($image1);
imagedestroy($image2);