I'm trying to create a composite image using GD consisting of a combiation of several PNGs with transparent areas plus a couple of single color background images.
The following code snippet creates an image with a colored background, loads a PNG file with transparent areas and copys the PNG to the first.
$Image = ImageCreate ( 700, 800 );
$background_color = ImageColorAllocate ($Image, 100, 155, 155);
$text_color = ImageColorAllocate ($Image, 233, 14, 91);
$Image1 = ImageCreateFromPNG ( "some.png" );
ImageCopy ( $Image, $Image1, 0, 0, 0, 0, 700, 800);
ImagePNG ( $Image );
ImageDestroy ( $Image );
It all works fine except that the areas that are supposed to be transparent now are white, instead of being the color of the underlying image.
Any suggestions on what I'm doing wrong here. Couldn't find anything searching the forums (or Google).