Re: Smart anti-aliasing

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

 



On Sun, Feb 12, 2006 at 01:40:42PM -0500, tedd wrote:
> Hi:
> 
> I know how to create a watermark by simply imposing one image on 
> another via imagecopy() or imagecopymerge().
> 
> However, is there a way to place a watermark on a image such that the 
> watermark is actually anti-aliased against the background of the base 
> image?
> 
> For example, please review:
> 
> http://xn--ovg.com/watermark2

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.
-- 
cat .signature: No such file or directory

-- 
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