<?php
$src='images/4.jpg';
$info=getimagesize($src);
// $x=$info[0]-100;
// $y=$info[1]-20;
$type=image_type_to_extension($info[2],false);
$newimage="imagecreatefrom{$type}";
$images = $newimage($src);
$mark="images/mark.png";
$markinfo=getimagesize($mark);
$marktype=image_type_to_extension($markinfo[2],false);
$newmark="imagecreatefrom{$marktype}";
$water=$newmark($mark);
imagecopymerge($images,$water,20,30,0,0,100,100,30);
// imagedestroy($water);
header("Content-type:".$info['mime']);
$new='image{$type}';
$new($images);
// imagedestroy($images);
?>