#40572 [Opn->Asn]: Alpha composite allows color to bleed through

From: Date: Wed, 21 Feb 2007 08:09:13 +0000
Subject: #40572 [Opn->Asn]: Alpha composite allows color to bleed through
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-109235@lists.php.net to get a copy of this message
ID: 40572 Updated by: tony2001@php.net Reported By: seth at pricepages dot org -Status: Open +Status: Assigned Bug Type: GD related Operating System: Mac 10.4 PHP Version: 5.2.1 -Assigned To: +Assigned To: pajoye Previous Comments: ------------------------------------------------------------------------ [2007-02-21 05:01:04] seth at pricepages dot org Description: ------------ I am filling the background of an image with a transparent red (it shouldn't have an effect on the rest of the drawing). Over it, I'm drawing a black, semi-transparent, square. Reproduce code: --------------- $img = imagecreatetruecolor(100, 100); imagealphablending($img, true); $trans = imagecolorresolvealpha($img,255,0,0, 127); imagefill($img, 0,0, $trans); $pTrans = imagecolorresolvealpha($img, 0,0,0, 64); imagefilledrectangle($img, 10, 10, 50, 50, $pTrans); imagealphablending($img, false); imagesavealpha($img,true); header('Content-Type: image/png'); imagepng($img); Expected result: ---------------- I would expect the resulting image to be 100% transparent, except for a grey, 50% transparent square. Actual result: -------------- Instead, the black is mixed with the red to form a dark-red semi-transparent square. The red color should not be there, because it was 100% transparent. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=40572&edit=1

« previous php.bugs (#109235) next »