Simply enough:
Call the function, get the returned filename.
Function Variables:
$file : The input file (source/background)
$destination : Where you want the new watermarked image to go
$overlay : The overlay image (foreground), this is default set (if not passed in) to "images/watermark.png"
$X : X-Position of overlay (default is 10)
$Y : Y-Position of overlay (default is 10)
The return is the destination file (this allows for dynamic watermarks)
Example Usage:
<img src='<?php echo watermark_image("sample.png", "temp/".time().".png"); ?>'>