Код (+/-)
header('Content-type: image/gif');
$img = $_GET['img'];
$wh = getimagesize('copy.png'); //////твой файл
$fh = getimagesize('http://сайт/' . $img);
$rwatermark = imagecreatefrompng('copy.png');
$sx = $fh[0] - $wh[0] - 0;
$sy = $fh[1] - $wh[1] - 0;
if (pathinfo($img, PATHINFO_EXTENSION) == 'jpg' || pathinfo($img, PATHINFO_EXTENSION) == 'jpeg') {
$rfile = imagecreatefromjpeg('http://сайт/' . $img);
imagecopy($rfile, $rwatermark, $sx, $sy, 0, 0, $wh[0], $wh[1]);
} elseif (pathinfo($img, PATHINFO_EXTENSION) == 'gif') {
$rfile = imagecreatefromgif('http://сайт/' . $img);
imagecopy($rfile, $rwatermark, $sx, $sy, 0, 0, $wh[0], $wh[1]);
} elseif (pathinfo($img, PATHINFO_EXTENSION) == 'png') {
$rfile = imagecreatefrompng('http://сайт/' . $img);
imagecopy($rfile, $rwatermark, $sx, $sy, 0, 0, $wh[0], $wh[1]);
}
imagegif($rfile, '', '100');
imagedestroy($rwatermark);
imagedestroy($rfile);