I'm having a rough time getting this transparent PNG (map marker) to be transparent being copied onto the larger PNG (radar image). I've tried a number of different things and all have failed. It must be something quirky because if I use a rectangle filled with a color and apply the map marker the transparency is respected. I'm stumped at the moment even though I'm still working the problem.
Below I've included dropbox links to the two images and the php code that I've been testing with. Once the transparency gets worked out I'm going to try and figure out how to resize the map marker, don't need it that big!
Thank you for your time and help!
<?php
//$im = @imagecreatetruecolor(1440,768) or die("Cannot Initialize new GD image stream");
$im = imagecreatefrompng('new_radar_image.png');
$color_red = imagecolorallocate ($im,255,0,0);
$color_white = imagecolorallocate ($im,255,255,255);
$radar_size_x = imagesx($im);
$radar_size_y = imagesy($im);
$mid_x = $radar_size_x / 2;
$mid_y = $radar_size_y / 2;
// imagefilledrectangle ( $im, 0 , 0 , 1439 , 767 , $color_red );
imageline ( $im, $mid_x , 0, $mid_x, $radar_size_y, $color_white);
imageline ( $im, 0, $mid_y, $radar_size_x, $mid_y , $color_white);
$src_im = imagecreatefrompng('map-marker-icon1.png');
imagecopy ( $im , $src_im , 0 , 0 , 0 , 0 , 128 , 128);
header('Content-Type: image/png');
imagealphablending( $im, false );
imagesavealpha( $im, true );
imagepng($im);
imagedestroy($im);
?>