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...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.