Watermark script

images php coding issues or problems here.

Moderators: macek, egami, gesf

Post Reply

Watermark script

Post by phpbaby » Fri Apr 07, 2006 12:31 am

Hi there,

Anyone know the script to water mark a image in php?

Thanks in advance

New php-forum User
New php-forum User
Posts: 90
Joined: Fri Dec 02, 2005 3:23 am

Post by sanketce » Fri Apr 07, 2006 12:59 am

Can you explain in more detail :)


Post by phpbaby » Fri Apr 07, 2006 8:32 am


When i add a picture to my server through the form , then a watermark for the uploaded picture is to be added below the picture. The watermark to be added nearly at the bottom of the picture automatically.

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Post by Alexej Kubarev » Fri Apr 07, 2006 8:57 am

User avatar
New php-forum User
New php-forum User
Posts: 156
Joined: Wed Mar 22, 2006 2:22 am
Location: Ahmedabad, Gujarat, India

Water mark

Post by Mukseh » Sun Apr 16, 2006 7:18 pm

Code: Select all

class water_mark {

    public static function apply($watermark, $img) {

        header('content-type: image/gif');

        $watermark = imagecreatefromgif($watermark);
        $watermark_width = imagesx($watermark);
        $watermark_height = imagesy($watermark);
        $image = imagecreatetruecolor($watermark_width, $watermark_height);
        $image = imagecreatefromgif($img);
        $size = getimagesize($img);
        $dest_x = $size[0] - $watermark_width -5;
        $dest_y = $size[1] - $watermark_height -5;
        imagecopymerge($image, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, 100);


Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest