|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36697 Transparency is lost when using imagecreatetruecolor
Submitted: 2006-03-11 15:14 UTC Modified: 2006-03-13 22:56 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: kraus at phoenixwebsolutions dot de Assigned: pajoye (profile)
Status: Closed Package: GD related
PHP Version: 5.1.2 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: kraus at phoenixwebsolutions dot de
New email:
PHP Version: OS:


 [2006-03-11 15:14 UTC] kraus at phoenixwebsolutions dot de
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:
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);
$text_color = ImageColorAllocate ($im, 233, 14, 91);

ImageString ($im, 1, 5, 5, "Ein Test-String", $text_color);
$res = imagecolortransparent($im, $background_color);



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-03-13 19:53 UTC]
Assigned to the maintainer.
 [2006-03-13 22:56 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Feb 02 12:05:53 2023 UTC