Edit report at http://bugs.php.net/bug.php?id=26928&edit=1
ID: 26928
Comment by: milton dot andrade at canalup dot tv
Reported by: michel at breggen dot nl
Summary: imagecreatetruecolor black background makes alpha
transparancy unusable
Status: Open
Type: Feature/Change Request
Package: GD related
Operating System: RedHat Linux
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Hi,
Not sure this is a bug.
if you do :
$im = imagecreatetruecolor(50,50);
header ("Content-type: image/x-png");
imagesavealpha($im, true);
$bg=imagecolorallocatealpha ($im, 0,0,0,127);
imagefill($im,0,0,$bg);
imagepng($im);
imagedestroy($im);
the result is what you want.
Previous Comments:
------------------------------------------------------------------------
[2004-01-15 23:31:57] michel at breggen dot nl
Description:
------------
when creating a new truecolor image, the image gets set with a black
background. This makes it unusable to blend alpha transparant png's onto
it (for creating transparant thumbnails for example). Normally you would
have a blank (all transparant) image when creating a new image because
no data has been added to it.
Reproduce code:
---------------
$img = imagecreatetruecolor(50,50);
header ("Content-type: image/x-png");
imagepng($img);
imagedestroy($img);
Expected result:
----------------
a transparant 50x50 png image.
Actual result:
--------------
a black 50x50 png image
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=26928&edit=1