Hi, is there a way to create file which has watermark? So if I have file a.jpg and watermark it with b.jpg to create a new file c.jpg. Is that posible?
hmm., do you want to add watermark by using php coding !! we use a good photo editor to add watermarks / merge images
edit : this post was composed & posted thru Quick Reply before looking at the above response here is a simple guide for batch watermarking with photoshop. I hope that you can find a better guide / tutorial for it
I'm hoping that there is a PHP code for this. Using photoshop means i need to download hundreds of images and upload it again.
A watermark can be made with PHP and GD quite easily. It's not complicated as such, but too in depth to explain on here. I'd suggest just doing a quick Google for 'watermarking images with PHP and GD' Also, I'd suggest using a .PNG to use as a watermark, as it will support full transparency, where as .JPG will not
i guess you can use the imagecopymerge function in php to do the same if you wish i can code it for you for few $ (as it might take me sometime to code it entirely as per your needs) I had made myself a script to do something similar but i was adding a text logo to all images in a folder and not an image watermark.
You might consider using an automatic watermark script that runs on your sever and automatically adds a selected watermark to your images. That way you don't have to alter your existing images.
I always use the composite command from ImageMagick to create a watermarked file with php. Something like: system ("composite -dissolve 50 -gravity SouthWest images/watermark.png " . $pathtoimage . " " . $pathtoimage); Code (markup): -dissolve tells it to only make the watermark file half visible, -gravity SouthWest puts the watermark in the bottom left corner of the image. I recommend using a png as your watermark source so it can have a transparent background. For more information on using composite see http://www.imagemagick.org/Usage/compose/
Thanks. I've look at it. But it seems it did not create a new file. So user can copy the file by looking at the source code.
I could also do this. What you would do is take use of the PHP GD library. Your main steps would be to load image a and b into memory via imagecreatefrom*() which creates an image resource that you can then "blit" b onto a. You would then use image*() to output the image data in a standard format. If image b, the watermark, is not rectangular in image, then it should have a transparent background so that it is not "blitted" with a black/white (or any other color) background.
I agree with TSelbeck, the best solution to your problem is to use PHP's GD Library: http://php.net/manual/en/book.image.php
You can create a new image file using GD library... Take a quick read and go through the examples, you just can't have a solution just by a single glance
http://www.php.net/manual/en/function.imagejpeg.php http://www.php.net/manual/en/function.imagepng.php http://www.php.net/manual/en/function.imagegif.php