SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Merging 2 PNGs and keeping transparency

  1. #1
    SitePoint Enthusiast appy's Avatar
    Join Date
    Feb 2002
    Location
    UK
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Merging 2 PNGs and keeping transparency

    Hi All,

    I haven't done much with GD so any help appreciated.

    I am creating one image out of two. One is a pretty picture, one is the frame. The frame is merged ontop of the pretty picture but the transparency is not coming through, any ideas?

    PHP Code:
    <?php

    $your_original_image 
    "img1.png";
    $your_frame_image "img2.png";

    $image imagecreatefrompng($your_original_image);
    $frame imagecreatefrompng($your_original_frame);

    imagealphablending($frame,true);
    imagesavealpha($frametrue);

     
    imagecopymerge($image$frame00005050100);

    header('Content-Type: image/png');
    imagepng($image);
     
     
    ?>
    Thanks in advance,

    Pete

  2. #2
    SitePoint Enthusiast appy's Avatar
    Join Date
    Feb 2002
    Location
    UK
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorted it - got tired so left it. Woke up re-wrote from scrtahc and it fine - don't ask me why? Tired eyes probably!

    Pete

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •