I need your help
I have two images,
1. http://i.imgur.com/pyWGk.jpg (face image, type: jpeg)
2. http://i.imgur.com/LYk07.png (frame image, with a hole in person, type: png)
I want to insert a face image in a frame image
I tried this script
<?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);
?>
The problem is as follows: The
resolution of the image of the result does not match the resolution of the image of the frame and
How to change the position of the image of the face, so the image of the face can be directly on the hole in the image of the frame
source
share