• Subcribe to Our RSS Feed

[WaterMark] How To Add WaterMark Image Into Uploaded Image In Php

Nov 26, 2012   //   by admin   //   Other, PHP  //  No Comments

Hi Friends,
I did make a script for add water mark image into uploaded image.In this script you can upload image in .png,.jpg or .gif format and using .png watermark you can generate new image with watermark.
You can set you water mark in different position whatever you want.I will explain you how you can change position of watermark image.

First of all we can see the code for generate image with watermark.

if($imagetype == ".png"){
elseif($imagetype == ".jpg"){
elseif($imagetype == ".gif"){
  $skipper= "1";	
if($skipper!= "1")
$image=imagecreatetruecolor($img_width, $watermark_height);
imagealphablending($image, false);
imagecopy($img,$watermark,$dest_x,$dest_y,0,0,$img_width,$watermark_height);                    imagesavealpha($img, true);

Using above code you can generate the image with watermarks.you can put watermark to different places
using imagecopy() function.you have to pass different argument for different position for more detail about argument you can read Php Manual.

All the Best.

Leave a comment