Ok ive been wracking my brains over this for absolutely ages and cant find a simple answer anywere not even on the php.net site so i was wondering if you could help me.
I have designed a gif file in photoshop with transparent backgrounds, but when i use
[PHP]$im = imagecreatefrom gif($imgname)[/PHP]
the transparent images are showing up as white and i cant seem to figure out how to keep the transparent background within the new image.
Surrounding Code
[PHP]
$im = imagecreatefrom gif($imgname);
$imsize = getimagesize($i mgname);
$colorTranspare nt = imagecolortrans parent($im);
$im2 = imagecreate($im size['0'],$imsize['1']);
imagepalettecop y($im2,$im);
imagefill($im2, 0,0,$colorTrans parent);
imagecolortrans parent($im2, $colorTranspare nt);
imagecopyresize d($im2,$im,0,0, 0,0,$imsize['0'],$imsize['1'], $imsize['0'], $imsize['1']);
[/PHP]
I would be most appreciative if someone can help me with this cus ive been looking for hours and cant find anything.
Kind Regards
Devon
I have designed a gif file in photoshop with transparent backgrounds, but when i use
[PHP]$im = imagecreatefrom gif($imgname)[/PHP]
the transparent images are showing up as white and i cant seem to figure out how to keep the transparent background within the new image.
Surrounding Code
[PHP]
$im = imagecreatefrom gif($imgname);
$imsize = getimagesize($i mgname);
$colorTranspare nt = imagecolortrans parent($im);
$im2 = imagecreate($im size['0'],$imsize['1']);
imagepalettecop y($im2,$im);
imagefill($im2, 0,0,$colorTrans parent);
imagecolortrans parent($im2, $colorTranspare nt);
imagecopyresize d($im2,$im,0,0, 0,0,$imsize['0'],$imsize['1'], $imsize['0'], $imsize['1']);
[/PHP]
I would be most appreciative if someone can help me with this cus ive been looking for hours and cant find anything.
Kind Regards
Devon
Comment