<?php watermark('img.png', 'watermark.png'); function watermark($dst_im, $src_im, $im_save=NULL){ $src_im = imagecreatefrompng($src_im);//create image from source $dst_im = imagecreatefrompng($dst_im);//create image from destination imagecopy($dst_im, $src_im, 0, 0, 0, 0, imagesx($src_im), imagesy($src_im));//merge watermark into image header('Content-type: image/png');//send image header to browser imagepng($dst_im);//send image content to browser } ?>
Sumber : http://daif.net/script/watermark.phps