I have problem in writing a transparent watermark in a Gif Image in php. It writes but do not show the transparency. I have an image that have a table with information i have to water mark in that file so that data shown on file should not be disturb. Means, watermark should be transparent and viewable.
Please help me. Code is something like this.
$imagesource="pics/2011/temp/15_03.gif";
$DestinationFile="pics/2011/15_03.gif";
$filetype = substr($imagesource,strlen($imagesource)-4,4);
$filetype = strtolower($filetype);
if($filetype == ".gif") $image = @imagecreatefromgif($imagesource);
if($filetype == ".jpg") $image = @imagecreatefromjpeg($imagesource);
if($filetype == ".png") $image = @imagecreatefrompng($imagesource);
if (!$image) die();
$imagewidth = imagesx($image);
$imageheight = imagesy($image);
$startwidth = (($imagewidth *20)/100);
$startheight = $imageheight - ($imageheight*20)/100;
//imagecopy($image, $watermark, $startwidth, $startheight, 0, 0, $watermarkwidth, $watermarkheight);
$color = imagecolorallocatealpha($image, 0, 111, 0,75);
imagettftext($image,24,60,$startwidth,$startheight,$color,'arial.ttf',"(c)www.Example.com");
imagejpeg($image,$DestinationFile,85);
imagedestroy($image);
Maybe you should create the watermark on another image and use the merge function: