Re: Smart anti-aliasing

From: Date: Sun, 12 Feb 2006 20:33:39 +0000
Subject: Re: Smart anti-aliasing
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-230275@lists.php.net to get a copy of this message
Create the image you are going to watermark with as a PNG, png doesn't suffer the issues of the antialiasing issues like GIF. You just want to make sure you use the function:
    imagealphablending();
On the original image before you apply the watermark in your merge. $image = imagecreatefromjpeg($source_file); imagealphablending($image, true) $watermark = imagecreatefrompng($watermark_file); and then just do your imagecopymerge() normally HTH, Curt.
Curt: First, thanks for helping. Second, I wasn't using a GIF -- my copyright was a png and my image was a jpg. Third, the following is my code, I think I'm following what you said -- but something is wrong -- the problem remains as shown here: http://xn--ovg.com/watermark3 --- code follows --- <?php $original=imagecreatefromjpeg("mydog.jpg"); imagealphablending($original, true); $watermark=imagecreatefrompng("copyright.png"); $osx=imagesx($original); $osy=imagesy($original); $wsx=imagesx($watermark); $wsy=imagesy($watermark); imagecopymerge($original, $watermark, ($osx-$wsx)/2, ($osy-$wsy)/2, 0, 0, $wsx, $wsy,100); imagepng($original, "trans.png"); ?> tedd -- -------------------------------------------------------------------------------- http://sperling.com/

« previous php.general (#230275) next »