// Transparency, 100 for none, 0 for not visible
$WaterMark_Transparency = "50";
// Import the images to use...
// We want the watermark to be a gif (transparency without the white.)
$WaterMark = imageCreateFromGIF("watermark.gif");
$Main_Image = imageCreateFromJPEG("image.jpg");
// Get the width and height of each image.
$Main_Image_width = imageSX($Main_Image);
$Main_Image_height = imageSY($Main_Image);
$WaterMark_width = imageSX($WaterMark);
$WaterMark_height = imageSY($WaterMark);
// This will be the position of the WaterMark
$MaterMark_x = ($Main_Image_width - $WaterMark_width);
$MaterMark_y = ($Main_Image_height - $WaterMark_height);
// We want to put the watermark on top of the main image.
imageCopyMerge($Main_Image, $WaterMark, $MaterMark_x, $MaterMark_y, 0, 0, $WaterMark_width, $WaterMark_height, $WaterMark_Transparency);
// Let the browser know that it is an image..
header("Content-Type: image/PNG");
// We want to show the image (in png format...)
ImagePNG ($Main_Image);
?>[/code]
This works. Anyone want to take a shot at creating a form to put images you want watermarked in there and save them on the server?
Oh.. Watermark has to be a GIF.....Statistics: Posted by Josh — Thu Nov 10, 2005 6:53 pm
]]>