I have the following scenario. There are two .png images with the exact same size. One is the background image and the other one is the overlay image.
The overlay consists of a transparent background and white letters.
I am trying to combine those two images into one so that I will end up having white text on the background image.
I tried it with this code:
$image_1 = imagecreatefrompng('newimages/'.$overla);
$imgFinal = imagecreatefrompng('imagebackrgounds/background.png');
imagealphablending($imgFinal, true);
imagesavealpha($imgFinal, false);
imagecopy($imgFinal, $image_1, 0, 0, 0, 0, 600, 579);
imagepng($imgFinal, 'new/new.png');
The code above only saves a white picture. What am I doing wrong here? Does someone have a working code?
This is the background picture:
This is the image with transparent background ( it should be on top of the background )