|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-05-04 18:24 UTC] author at ninelivescomic dot com
Hi, I'm using php to return the color of a 4-bit png image with binary transparency. This code:
/* begin php code */
$imgBase= imageCreateFromPNG("20030429a.png");
print(imageColorTransparent($imgBase));
/* end php code */
prints -1, which I assume means "no transparent color". I'm sure there IS a transparant color in the image. I've tried this with both an optimized and non-optimized palette, same results. I'm using gd library 1.6.2, and can send the image if that helps.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 22:00:02 2025 UTC |
Hi, I'm using php to return the transparent color of a 4-bit png image with binary transparency. This code: /* begin php code */ $imgBase= imageCreateFromPNG("20030429a.png"); print(imageColorTransparent($imgBase)); /* end php code */ prints -1, which I assume means "no transparent color". I'm sure there IS a transparent color. I've tried this with both an optimized and non-optimized palette, same results. I'm using gd library 1.6.2, and can send the image if it helps.Recompiled php, using gd bundled (2.0 compatible). This code: <?php $imgStrip= imageCreateFromPNG("20030509.png"); header("Content-type: image/png"); imagePNG($imgStrip); imageDestroy($imgStrip); ?> Displays the image without the transparency, even though I know it has it. Displaying imageing <IMG> tag looks fine.Items sent. Here's a copy if you need it: test.html: <html> <body bgcolor= "#ffffcc"> <p>Using <img src="test.php" />:<br /> <img src="test.php" /></p> <p>Using <img src="test.png" />:<br /> <img src="test.png" /></p> </body></html> test.php: <?php $gdTest= imageCreateFromPNG("test.png"); header("Content-type: image/png"); imagePNG($gdTest); imageDestroy($gdTest); ?> test.png was copied directly from http://static.php.net/www.php.net/images/logos/php-med-trans.png. Running test.html shows the same picture, one with transparency on, one with it off. Thanks for your help!