<?php
// Transparency, 100 for none, 0 for not visible
$WaterMark_Transparency = "50";
// Import the images to use...
// the watermark is a gif (transparency without
the white.)
$WaterMark = imageCreateFromGIF("water.gif");
$Main_Image = imageCreateFromPNG("pig.png");
// 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);
// calculate the position of the WaterMark
$MaterMark_x = ($Main_Image_width - $WaterMark_width);
$MaterMark_y = ($Main_Image_height - $WaterMark_height);
//put the watermark on top
of the background 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");
// show the image in png format(sharper image)
ImagePNG ($Main_Image);
?> |