If I were doing this, I would attempt to un-set the PNG transparency right
after loading in the PNG...
But I wouldn't know an alpha channel if it bit me :-)
--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: Vahan Yerkanian <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Monday, August 27, 2001 6:40 AM
Subject: overlaying alpha channel png over jpeg
> I hope someone has got solution for this:
>
> I'm trying to write a script which will watermark a jpeg file with png
logo,
> and output the resulting jpeg to a file. Unfortunately, whatever I do, I'm
> unable to get transparent color in png to disappear, by any means.
>
> the png file is 8bit, jpeg is true color;
> Am I doing something wrong? have a look:
>
> <?
>
> $sourcefile="test2.jpg";
> $insertfile="peoplestamp.png";
> $targetfile="test.jpg";
> $transition=50;
>
>
> $insertfile_id = imageCreateFromPNG($insertfile);
> $sourcefile_id = imageCreateFromJPEG($sourcefile);
>
>
> $sourcefile_width=imageSX($sourcefile_id);
> $sourcefile_height=imageSY($sourcefile_id);
> $insertfile_width=imageSX($insertfile_id);
> $insertfile_height=imageSY($insertfile_id);
>
> $dst = imageCreateTrueColor($sourcefile_width,$sourcefile_height);
> imagealphablending($dst,TRUE);
>
imagecopy($dst,$sourcefile_id,0,0,0,0,$sourcefile_width,$sourcefile_height);
>
>
> $aaa=imagecolorresolvealpha($insertfile_id,255,255,255,255);
>
> imagecolortransparent($insertfile_id,$aaa);
>
> imageCopyMerge($dst,
> $insertfile_id,0,0,0,0,$insertfile_width,$insertfile_height,$transition);
> imagepng ($dst,"$targetfile");
>
>
> ?>
> <img src="<?=$targetfile?>" border=0>
>
> Best regards,
> --
> Vahan Yerkanian
[EMAIL PROTECTED]
> Vice President, Design & Development Website @
http://www.abideweb.com/
> AbideWeb Technologies, LLC Phone +3741 238650 | Mobile +3749
416358
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]