GD2 overlaying image with rounded (transparent) corners

Discussion in 'PHP' started by RaF007, Apr 2, 2009.

  1. #1
    After a few hours of testing & failing, I'm at a blank and need some help.

    I have a script which uses GD to resize a series of images. Next to that it must overlay a small image in the bottom right corner, a watermark.

    The problem is that the image I need to overlay, has rounded corners (check attachement). Simply overlaying the image will make those transparent parts (space where the corner is rounded) black, while I need it to stay transparent. Using a transparency pct will make the whole image transparent, which I do not need because I only need it to be transparent on the corners.

    Could someone please help me because I'm all out of ideas.
     

    Attached Files:

    • test.png
      test.png
      File size:
      584 bytes
      Views:
      233
    RaF007, Apr 2, 2009 IP
  2. NatalicWolf

    NatalicWolf Peon

    Messages:
    262
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #2
    http://rs.bahneman.com/wm.php.html

    An example on doing this.
     
    NatalicWolf, Apr 2, 2009 IP
  3. RaF007

    RaF007 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks a lot NatalicWolf.

    I was using imagecopymerge, the example you provided used imagecopy. This works just like I need. :)
     
    RaF007, Apr 3, 2009 IP