Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default Png transparency

    I've been trying to just open a png and display it, that way:

    <?
    header ("Content-type: image/png");
    $im = imagecreatefrompng('empty.png');
    imagepng($im);
    ?>

    But the transparency is not kept. I did try in netscape too,
    but it's visible even in explorer, when comparing how the
    direct image looks and how it looks when thru the script, that
    transparency was killed.

    Ideas (on how to solve or at least which, from
    imagecreatefrompng or imagepng, kills the transparency) ?
    I got php 4.3.1 and the bundled GD of it.
    Cecile Muller Guest

  2. Similar Questions and Discussions

    1. What about transparency am I not getting?
      This is sort of like What about NO do you not understand? But Nancy T said this was the place to ask, so I am. When I use the word transparency, I...
    2. Transparency
      Hello, appologies if this has been asked, I couldn't find it. How do I change a block of colour in an image to be transparent ? I have an animated...
    3. Transparency in 3D
      Hi I am new with Shockwave 3D and I am interested to know if there is a way to make the background of a 3D scene transparent. I might need to...
    4. transparency effect???
      Hello, I would like to know how to create transparency effect in flash? I have no idea how to put a image looks transparent with another image...
    5. Need help with transparency
      How do I make the white canvas of the logo transparent while leaving the text "Focus" white? http://www.teamfocusinc.com/new_site/index.htm ...
  3. #2

    Default Re: Png transparency

    Cecile Muller wrote:
    > I've been trying to just open a png and display it, that way:
    >
    > <?
    > header ("Content-type: image/png");
    > $im = imagecreatefrompng('empty.png');
    > imagepng($im);
    > ?>
    >
    > But the transparency is not kept. I did try in netscape too,
    > but it's visible even in explorer, when comparing how the
    > direct image looks and how it looks when thru the script, that
    > transparency was killed.
    >
    > Ideas (on how to solve or at least which, from
    > imagecreatefrompng or imagepng, kills the transparency) ?
    > I got php 4.3.1 and the bundled GD of it.
    If it worked in Netscape, and not explorer, that's normal. However,
    there is a workaround you can use in the image tag:

    [url]http://www.koivi.com/ie-png-transparency/[/url]

    HTH

    --
    Justin Koivisto - [email]spam@koivi.com[/email]
    PHP POSTERS: Please use comp.lang.php for PHP related questions,
    alt.php* groups are not recommended.

    Justin Koivisto Guest

  4. #3

    Default Re: Png transparency

    I had the same problem. If you create the .png as a 'true color' graphic,
    it will not be transparent. When I created the same graphic using a '256
    color' palatte, transparency worked fine.

    Pat Scott
    "Cecile Muller" <spam@wildpeaks.com> wrote in message
    news:aff31ac6.0308131736.7b1c0e56@posting.google.c om...
    > I've been trying to just open a png and display it, that way:
    >
    > <?
    > header ("Content-type: image/png");
    > $im = imagecreatefrompng('empty.png');
    > imagepng($im);
    > ?>
    >
    > But the transparency is not kept. I did try in netscape too,
    > but it's visible even in explorer, when comparing how the
    > direct image looks and how it looks when thru the script, that
    > transparency was killed.
    >
    > Ideas (on how to solve or at least which, from
    > imagecreatefrompng or imagepng, kills the transparency) ?
    > I got php 4.3.1 and the bundled GD of it.

    Pat Scott Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139