Jump to content

Watermark border, is this possible? PICS inside


phillips321

Recommended Posts

Hi guys,

 

My site takes in a photo and currently adds a watermark to the bottom right as shown by the code at the bottom of this message.

 

Instead i would like to take in an image like this:

picwithoutborder.jpg

and turn it into a pic like this

picwithborder.jpg

 

how could this be done? i guess the logical way to do it would be to create another image +40px on both height and width and then apply the original image to the centre of the new image.

I would then need to get the border going around the outside in some sort of fasion.

 

Cheers in advance

 

imagealphablending($img, true); //turn on transparency on image
$overlay = imagecreatefrompng($overlay); //create overlay image using user set file
$owidth = imagesx($overlay); //get width of overlay image
$oheight = imagesy($overlay); //get height of overlay image
imagecopy($img, $overlay, $iwidth - $owidth, $iheight - $oheight, 0, 0, $owidth, $oheight); //apply overlay to image
imagedestroy($overlay); //Get rid of temporary overlay file...

It kind of defeats the purpose of a watermark to have it on the edge. If somebody steals your image and crops it, they basically have the regular image. Ideally the watermark goes right through the focal point of the image.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.