|  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
12 + 13 = ?
Subscribe to this entry?

 [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: Fri Aug 19 09:05:50 2022 UTC