Create watermark image

Discussion in 'PHP' started by goodmast3r, May 20, 2011.

  1. #1
    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?
     
    goodmast3r, May 20, 2011 IP
  2. mnmani

    mnmani Well-Known Member

    Messages:
    379
    Likes Received:
    11
    Best Answers:
    6
    Trophy Points:
    195
    #2
    hmm., do you want to add watermark by using php coding !!
    we use a good photo editor to add watermarks / merge images :)
     
    mnmani, May 20, 2011 IP
  3. goodmast3r

    goodmast3r Active Member

    Messages:
    1,220
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    78
    #3
    The problem is there are hundreds of images. So i want to create images with photoshop
     
    goodmast3r, May 20, 2011 IP
  4. commitment

    commitment Peon

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Hello,
    You can use "Easy Watermark Studio". This is one of good tool for watermark.
     
    commitment, May 20, 2011 IP
  5. mnmani

    mnmani Well-Known Member

    Messages:
    379
    Likes Received:
    11
    Best Answers:
    6
    Trophy Points:
    195
    #5
    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 :)
     
    mnmani, May 20, 2011 IP
  6. goodmast3r

    goodmast3r Active Member

    Messages:
    1,220
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    78
    #6
    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.
     
    goodmast3r, May 20, 2011 IP
  7. TSelbeck

    TSelbeck Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    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 :)
     
    TSelbeck, May 20, 2011 IP
  8. niks00789

    niks00789 Well-Known Member

    Messages:
    188
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    110
    #8
    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.
     
    niks00789, May 21, 2011 IP
  9. rainborick

    rainborick Well-Known Member

    Messages:
    424
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    120
    #9
    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.
     
    rainborick, May 21, 2011 IP
  10. superdav42

    superdav42 Active Member

    Messages:
    125
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    58
    #10
    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/
     
    superdav42, May 21, 2011 IP
  11. goodmast3r

    goodmast3r Active Member

    Messages:
    1,220
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    78
    #11
    imagecopymerge does not create a new file
     
    goodmast3r, May 21, 2011 IP
  12. goodmast3r

    goodmast3r Active Member

    Messages:
    1,220
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    78
    #12
    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.
     
    goodmast3r, May 21, 2011 IP
  13. Sefrez

    Sefrez Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    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.
     
    Sefrez, May 21, 2011 IP
  14. Mak3MyDay

    Mak3MyDay Peon

    Messages:
    25
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #14
    Mak3MyDay, May 21, 2011 IP
  15. goodmast3r

    goodmast3r Active Member

    Messages:
    1,220
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    78
    #15
    Guys please read the thread. I'm looking for a solution that will create a NEW file.
     
    goodmast3r, May 21, 2011 IP
  16. Mak3MyDay

    Mak3MyDay Peon

    Messages:
    25
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #16
    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
     
    Mak3MyDay, May 21, 2011 IP
  17. goodmast3r

    goodmast3r Active Member

    Messages:
    1,220
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    78
    #17
    Really? Can you show me? Maybe I miss it.
     
    goodmast3r, May 21, 2011 IP
  18. Mak3MyDay

    Mak3MyDay Peon

    Messages:
    25
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
  19. goodmast3r

    goodmast3r Active Member

    Messages:
    1,220
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    78
  20. Mak3MyDay

    Mak3MyDay Peon

    Messages:
    25
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #20
    Welcome :)
     
    Mak3MyDay, May 21, 2011 IP