Yep, of course I can, as one of the people who requested whether I knew how to do it after receiving my image upload/resize script and was trying to achieve the very same thing only a few days ago.
Anyway here goes:
Start by uploading the image you wish to use as a watermark into your server space. A transparent GIF or PNG appears to work best.
You need to declare the FULL server filepath for this image and assign it to a variable (mine is assigned to the variable $watermark)
Declare the full executable path to the IM "composite" program. (declared into the variable $composite)
Declare the full server path for both the taget image to be watermarked AND the target filename/path for your composited image.
Composite takes 3 parameters minimum (my example using 4) and (in real language) does the following:
Composite (create new composed image) placing at start point X,Y the overlay image "image" ONTO the base image "base" and name it "new image".
You could of course specify the target output image as being the same as the input image.
The following was added to my upload test script at http://www.siwis-demos.co.uk/phptest and as such the variable $resized_image comes from previous manipulations within the script.
// Watermarking Test
// Filename for watermark overlay image
$wmimage = "overlay.gif";
// Server path to the above
$watermark = "$photopath" . "$wmimage";
// Declare a new filename for the composited image
$watermarked_image = "wm_" . "$resized_image";
// Declare full path to that image
$watermarked = "$photopath" . "$watermarked_image";
exec("$composite -geometry +75+25 $watermark $resized $watermarked");
This produces an image with overlay.gif dropped onto the original image with the watermark upper left corner at X=75 Y=25. As overlay.gif has transparency set, the background of that image remains transparent such that the original image can be seen through it.