View Single Post
  #1  
Old 08-25-2006, 09:31 AM
gareth gareth is offline
Junior Member
 
Join Date: Aug 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
gareth is on a distinguished road
Default poor quality watermark

I'm trying to watermark images as they are uploaded by a PHP script. Unfortunately, the output quality of the watermark is very poor.

Here is the script I'm using:

Code:

$thumb = imagecreatetruecolor($newwidth, $newheight);
$source = imagecreatefromjpeg("originalimage.jpg");
imagecopyresampled($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);

$overlay=imagecreatefrompng("../watermark.png");
$x=$newwidth-240;
$y=$newheight-38;
imagecopymerge($thumb,$overlay,$x,$y,0,0,$newwidth ,$newheight,60);
imagejpeg($thumb,"output.jpg",100);

Am I doing anything wrong? Guide -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
  Webmaster Forums - View Single Post - poor quality watermark
View Single Post
  #1  
Old 08-25-2006, 09:31 AM
gareth gareth is offline
Junior Member
 
Join Date: Aug 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
gareth is on a distinguished road
Default poor quality watermark

I'm trying to watermark images as they are uploaded by a PHP script. Unfortunately, the output quality of the watermark is very poor.

Here is the script I'm using:

Code:

$thumb = imagecreatetruecolor($newwidth, $newheight);
$source = imagecreatefromjpeg("originalimage.jpg");
imagecopyresampled($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);

$overlay=imagecreatefrompng("../watermark.png");
$x=$newwidth-240;
$y=$newheight-38;
imagecopymerge($thumb,$overlay,$x,$y,0,0,$newwidth ,$newheight,60);
imagejpeg($thumb,"output.jpg",100);

Am I doing anything wrong? Guide -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote