Edit: Forgot to tell, this require GD. Read more at http://php.net/gd
CODE
<?php
/* (X) Tell the browser that this script, is a image. */
header("Content-type: image/png");
/* (U) Generate our watermark picture. */
$Watermark = imagecreatefrompng("watermark.png");
/* (X) Genererate our picture, where we want to put the watermark. */
$Image = imagecreatefromjpeg("image.jpg");
/* (I) Get the color at x: 0. y: 0. in our Watermark, and use that color, as the transparency color. */
imagecolortransparent($Watermark,imagecolorat($Watermark,0,0));
/*
* (I) Merge the two images.
* In english:
* Get $Image and $Watermark, and put them together.
* $PosX will return the right side of the image. And then substract 5px from it. So it isn't aligned to the right border.
* $PosY will do the same. Except this is the y axis. And will go to the bottom. And then 5px away from it.
* When you use both, it will return the corner. -5px of it. From both the bottom, and right side.
* Note that a image start at x: 0. y: 0, in the upper left corner.
* Set the size.x of $Watermark, and size.y too.
* Transparent: 25
*/
$PosX = imagesx($Image)-imagesx($Watermark)-5;
$PosY = imagesy($Image)-imagesy($Watermark)-5;
imagecopymerge($Image,$Watermark,$PosX,$PosY,0,0,imagesx($Watermark),imagesy($Watermark),25);
/* (X) And then generate our new image, as a png. */
imagepng($Image);
?>
/* (X) Tell the browser that this script, is a image. */
header("Content-type: image/png");
/* (U) Generate our watermark picture. */
$Watermark = imagecreatefrompng("watermark.png");
/* (X) Genererate our picture, where we want to put the watermark. */
$Image = imagecreatefromjpeg("image.jpg");
/* (I) Get the color at x: 0. y: 0. in our Watermark, and use that color, as the transparency color. */
imagecolortransparent($Watermark,imagecolorat($Watermark,0,0));
/*
* (I) Merge the two images.
* In english:
* Get $Image and $Watermark, and put them together.
* $PosX will return the right side of the image. And then substract 5px from it. So it isn't aligned to the right border.
* $PosY will do the same. Except this is the y axis. And will go to the bottom. And then 5px away from it.
* When you use both, it will return the corner. -5px of it. From both the bottom, and right side.
* Note that a image start at x: 0. y: 0, in the upper left corner.
* Set the size.x of $Watermark, and size.y too.
* Transparent: 25
*/
$PosX = imagesx($Image)-imagesx($Watermark)-5;
$PosY = imagesy($Image)-imagesy($Watermark)-5;
imagecopymerge($Image,$Watermark,$PosX,$PosY,0,0,imagesx($Watermark),imagesy($Watermark),25);
/* (X) And then generate our new image, as a png. */
imagepng($Image);
?>
That should be it!
If you have any questions. Feel free to ask me. I'll answer them! If I'm able to.