php图片水印代码

在php中给图片增加水印有imagecreatefromjpeg imagecreatefrompng imagecopymerge imagejpeg就成了,只要你设置原图与水印图片就成了,下面看实例.

  1. header("content-type: image/jpeg");
  2. $filename='temp/www.phpfensi.com/phpfensi.com.jpg';
  3. $im=imagecreatefromjpeg($filename);
  4. $s=imagecreatefrompng('mb.phpfensi.com/pic/water_template.png');
  5. imagecopymerge($im,$s,0,200,0,0,365,27,20);
  6. imagejpeg($im);