I have tried many solutions and the truth and got to the point where you do not know what else to do.
The following image is a PNG ("cover.png"):
As you will have a blank oval really is completely transparent. With PHP I'm trying to fuse it to this picture ("lapiz.jpg"):
However, despite how much I've tried to not get the clear space of the first image is transparent and instead goes completely blank, covering the image that should melt.
For now this is my code:
$img_user = 'fotos/lapiz.jpg';
$img_user_type = getImageInfo($img_user,'type');
$posX = 404;
$posY = 2;
$width = getImageInfo($img_user,'width');
$height = getImageInfo($img_user,'height');
$stamp = 'fotos/cover.png';
switch($img_user_type)
{
case 'jpeg':
$img_user_create = imagecreatefromjpeg($img_user);
break;
case 'gif':
$img_user_create = imagecreatefromgif($img_user);
break;
case 'png':
$img_user_create = imagecreatefrompng($img_user);
break;
}
$im = imagecreatefrompng($stamp);
imagealphablending($im, false);
imagesavealpha($im, true);
imagecolortransparent($im, imagecolorallocate($im, 255, 255, 255));
imagecopymerge($img_user_create, $im, $posX, $posY, 0, 0, $width, $height, 100);
header('Content-Type: image/png');
imagepng($im);
ImageDestroy($im);
ImageDestroy($img_user_create);
What I can be doing wrong?