phpQuestioner Posted October 2, 2007 Share Posted October 2, 2007 Can you create a gd image watermark with 2 separate images? If so, does anyone know where I can see a good example of this. Right now I have a script that creates a image and uses another image to watermark it. But I want to be able to use two separate images to create one watermark on the gd image. The base image is from my file manager; so I am using the imagecreatefrompng() function. Does any one know of a way to accomplish 2 different watermark images as one over the base image? Quote Link to comment https://forums.phpfreaks.com/topic/71482-solved-using-more-than-one-water-mark/ Share on other sites More sharing options...
MadTechie Posted October 2, 2007 Share Posted October 2, 2007 Heres a basic watermarker.. just use imagecopy to create 2 watermarks in one or run this twice.. <?php header('content-type: image/jpeg'); $watermark = imagecreatefrompng('watermark.png'); $watermark_width = imagesx($watermark); $watermark_height = imagesy($watermark); $image = imagecreatetruecolor($watermark_width, $watermark_height); $image = imagecreatefromjpeg($_GET['src']); imagealphablending($image, true); $size = getimagesize($_GET['src']); $dest_x = $size[0] - $watermark_width - 5; $dest_y = $size[1] - $watermark_height - 5; imagecopy($image, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height); imagejpeg($image); imagedestroy($image); imagedestroy($watermark); ?> any problem just ask Quote Link to comment https://forums.phpfreaks.com/topic/71482-solved-using-more-than-one-water-mark/#findComment-359844 Share on other sites More sharing options...
phpQuestioner Posted October 2, 2007 Author Share Posted October 2, 2007 MadTechie, What do you mean by run it twice? Quote Link to comment https://forums.phpfreaks.com/topic/71482-solved-using-more-than-one-water-mark/#findComment-359863 Share on other sites More sharing options...
MadTechie Posted October 2, 2007 Share Posted October 2, 2007 the example above basically create one image out of two, so you could use it to create a (two in one watermark, then use that (two in one) on another image to make a three in one image Quote Link to comment https://forums.phpfreaks.com/topic/71482-solved-using-more-than-one-water-mark/#findComment-359868 Share on other sites More sharing options...
phpQuestioner Posted October 2, 2007 Author Share Posted October 2, 2007 Oh - OK I Figured It Out - Thank You For Your Help MadTechie Quote Link to comment https://forums.phpfreaks.com/topic/71482-solved-using-more-than-one-water-mark/#findComment-359870 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.