Re: Smart anti-aliasing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux