|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12963 ImageColorAllocate() doesn't work with PNGs
Submitted: 2001-08-26 06:01 UTC Modified: 2001-10-02 19:11 UTC
From: perry at globalnet dot co dot uk Assigned:
Status: Closed Package: GD related
PHP Version: 4.0.6 OS: Windows95
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: perry at globalnet dot co dot uk
New email:
PHP Version: OS:


 [2001-08-26 06:01 UTC] perry at globalnet dot co dot uk
header ("Content-type: image/png");
$text=implode($argv," ");
$background_color = ImageColorAllocate ($im, 100, 100, 255);
This is only a small modification of the example given in the manual, but the $text_color is always white.

This works for JPEG, but the quality suffers, and my build of PHP doesn't support GIF's.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-08-26 06:35 UTC]
I'm not a PNG expert but you could try ImageColorResolve() 
The palette used in 'basic.png' may be different than you

 [2001-08-27 18:09 UTC]
PHP 4.0.6 on win32 uses GD 2.0.1 BETA.
It is broken for palette based PNG images; you
need to use a different version of GD, or wait for PHP 4.0.7.

 [2001-10-02 19:11 UTC]
Not really a PHP bug. But will be fixed for 4.0.7 (which will use older and working GD libraries)
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Aug 17 16:05:45 2022 UTC