我需要你的帮助
我有两张图片,
1. http://i.imgur.com/pyWGk.jpg (人脸图像, 类型: jpeg)
2. http://i.imgur.com/LYk07.png (框架图像, 带有脸部空洞, 类型: png)
我想把人脸图像插入到框架图像中
我尝试了这个脚本
<?php
$image = imagecreatefromjpeg('face.jpg');
$frame = imagecreatefrompng('ironman.png');
$iw = imagesx($image);
$ih = imagesy($image);
$fw = imagesx($frame);
$fh = imagesy($frame);
imagealphablending($frame, true);
imagesavealpha($frame, true);
imagecopy($image, $frame, 0, 0, 0, 0, $fw, $fh);
header('Content-Type: image/jpeg');
imagejpeg($image);
imagedestroy($image);
imagedestroy($frame);
?>
问题如下:
结果图像的分辨率与框架图像的分辨率不同,以及
如何更改人脸图像的位置,使人脸图像在框架图像的孔上正确显示