Watermarking an Image
Posted: Thu Jan 10, 2013 3:16 pm
Hello fellers!
I'm new on the forum but I wanted to ask about something
I'm trying to make a watermark on an image I have med with php
Like this:
[syntax=php]<?php
$im = ImageCreate(500,100);
$white = ImageColorAllocate($im,0xFF,0xFF,0xFF);
$black = ImageColorAllocate($im,0x00,0x00,0x00);
$color = ImageColorAllocate($im,57,57,57);
$red = ImageColorAllocate($im,250,0,0);
$num = rand(1,3);
ImageFilledRectangle($im,0,0,500,100,$color);
ImageRectangle($im, 0, 0, 499, 99, $red);
ImageRectangle($im, 4, 4, 495, 95, $red);
//$rep = ImageCreateFromJPEG("http://i48.tinypic.com/w6xssz.jpg");
//$thanks = ImageCreateFromPNG("http://i.minus.com/ijp06izjgIy7G.png");
if($num == 1){
ImageString($im, 5, 100, 30, 'If I helped you in any way please', $red);
ImageString($im, 5, 110, 50, 'Click "Thankyou" and/or +rep me ', $red);
}else if($num == 2){
ImageString($im, 5, 90, 30, 'Please click "Thankyou" and/or +rep me ', $red);
ImageString($im, 5, 110, 50, 'If I have helped you in any way!', $red);
}else if($num == 3){
ImageString($im, 5, 90, 30, 'Just Because You Come From A Bad Place', $red);
ImageString($im, 5, 92, 50, 'Does Not Mean You Can\'t Do Good Things', $red);
ImageString($im, 5, 165, 70, 'I Just Choose Not To', $red);}
header('Content-Type: image/png');
ImagePNG($im);
?>[/syntax]
I have watched the tutorials from: http://www.youtube.com/user/betterphp on the subject but I can't figure out how to do it anyways
And the watermark need to be a linked image from another site
Can someone on here please help me with this?
many thanks!
I'm new on the forum but I wanted to ask about something
I'm trying to make a watermark on an image I have med with php
Like this:
[syntax=php]<?php
$im = ImageCreate(500,100);
$white = ImageColorAllocate($im,0xFF,0xFF,0xFF);
$black = ImageColorAllocate($im,0x00,0x00,0x00);
$color = ImageColorAllocate($im,57,57,57);
$red = ImageColorAllocate($im,250,0,0);
$num = rand(1,3);
ImageFilledRectangle($im,0,0,500,100,$color);
ImageRectangle($im, 0, 0, 499, 99, $red);
ImageRectangle($im, 4, 4, 495, 95, $red);
//$rep = ImageCreateFromJPEG("http://i48.tinypic.com/w6xssz.jpg");
//$thanks = ImageCreateFromPNG("http://i.minus.com/ijp06izjgIy7G.png");
if($num == 1){
ImageString($im, 5, 100, 30, 'If I helped you in any way please', $red);
ImageString($im, 5, 110, 50, 'Click "Thankyou" and/or +rep me ', $red);
}else if($num == 2){
ImageString($im, 5, 90, 30, 'Please click "Thankyou" and/or +rep me ', $red);
ImageString($im, 5, 110, 50, 'If I have helped you in any way!', $red);
}else if($num == 3){
ImageString($im, 5, 90, 30, 'Just Because You Come From A Bad Place', $red);
ImageString($im, 5, 92, 50, 'Does Not Mean You Can\'t Do Good Things', $red);
ImageString($im, 5, 165, 70, 'I Just Choose Not To', $red);}
header('Content-Type: image/png');
ImagePNG($im);
?>[/syntax]
I have watched the tutorials from: http://www.youtube.com/user/betterphp on the subject but I can't figure out how to do it anyways
And the watermark need to be a linked image from another site
Can someone on here please help me with this?
many thanks!