$tileImg = imagecreatefrompng($srcImagePath);
imagealphablending($tileImg,true);
imagecolortransparent($tileImg, imagecolorallocatealpha($tileImg, 255, 255, 255, 0));
imagecopymerge($mapImage, $tileImg, $x, $y,0, 0, $tileWidth, $tileHeight,100);
imagedestroy($tileImg);
$bgColor = imagecolorallocate($mapImage, 255, 255, 255);
imagefill($mapImage, 0, 0, $bgColor);
I am trying to get transparent image with but somehow the background come up in black color...
Please help.