#36697 [Opn->Asn]: Transparency is lost when using imagecreatetruecolor

From: Date: Mon, 13 Mar 2006 18:53:39 +0000
Subject: #36697 [Opn->Asn]: Transparency is lost when using imagecreatetruecolor
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-94304@lists.php.net to get a copy of this message
ID: 36697 Updated by: tony2001@php.net Reported By: kraus at phoenixwebsolutions dot de -Status: Open +Status: Assigned Bug Type: GD related Operating System: Linux PHP Version: 5.1.2 -Assigned To: +Assigned To: pajoye New Comment: Assigned to the maintainer. Previous Comments: ------------------------------------------------------------------------ [2006-03-11 15:14:20] kraus at phoenixwebsolutions dot de Description: ------------ If the function imagecreatetruecolor function is used instead of imagecreate the transparent color seems to get lost when scaling down the color palette if the image is exported as gif. Reproduce code: --------------- <?php header ("Content-type: image/png"); $im = @imagecreatetruecolor(50, 100) or die ("Kann keinen neuen GD-Bild-Stream erzeugen"); #$im = @imagecreate(50, 100) # or die ("Kann keinen neuen GD-Bild-Stream erzeugen"); $background_color = ImageColorAllocate ($im, 100, 100, 100); $rect_color = ImageColorAllocate ($im, 200, 0, 0); ImageFilledRectangle($im,0,0,50,100,$backgroundcolor); ImageFilledRectangle($im,0,0,50,50,$rect_color); $text_color = ImageColorAllocate ($im, 233, 14, 91); ImageString ($im, 1, 5, 5, "Ein Test-String", $text_color); $res = imagecolortransparent($im, $background_color); #var_dump($res);var_dump($background_color); ImageGIF($im); ?> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36697&edit=1

« previous php.bugs (#94304) next »