There are a bunch of functions floating around that use the GD library to put a watermark on an image. Here's one that I found on this forum that you can play around with:
function watermark($srcfilename, $newname, $watermark, $quality) {
$imageInfo = getimagesize($srcfilename);
$width = $imageInfo[0];
$height = $imageInfo[1];
$logoinfo = getimagesize($watermark);
$logowidth = $logoinfo[0];
$logoheight = $logoinfo[1];
$horizextra =$width - $logowidth;
$vertextra =$height - $logoheight;
$horizmargin = round($horizextra / 2);
$vertmargin = round($vertextra / 2);
$photoImage = ImageCreateFromJPEG($srcfilename);
ImageAlphaBlending($photoImage, true);
$logoImage = ImageCreateFromPNG($watermark);
$logoW = ImageSX($logoImage);
$logoH = ImageSY($logoImage);
ImageCopy($photoImage, $logoImage, ImageSX($photoImage)-$logoW, ImageSY($photoImage)-$logoH, 0, 0, $logoW, $logoH);
//ImageJPEG($photoImage); // output to browser
ImageJPEG($photoImage,"images/watermarked/wm_".$newname, $quality);
ImageDestroy($photoImage);
ImageDestroy($logoImage);
}
Good luck.