Re: PHP + GD + PNG color table troubles

From: Date: Wed, 29 Nov 2000 17:25:25 +0000
Subject: Re: PHP + GD + PNG color table troubles
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-27841@lists.php.net to get a copy of this message
On Wed, 29 Nov 2000, indrek siitan wrote: > i'm having trouble with my PHP script, that is supposed to open > a template and print the selected text on the template using GD. > > the problem is that when i save my template .PNG as a RGB file > (16 million colors), the colors get screwed up. playing around, > I found that the colors are right when I save the PNG as "indexed > color" (256-color). BUT, the text what is supposed to be written > on the image, is not in the right color - looks like the > ImageColorAllocate() function does not allocate a new color, but > instead tries to find the closest in the existing ones (which, > since the template is in quite different colors than the text, > fails miserably). I added the text color to the palette in > PhotoShop - then the text color was right, but the nearest colors > (antialiasing) were still screwed up. It may interest you to know that GD doesn't support full color PNG's, only indexed color ones. This is because rather than properly implementing PNG support, the GD library simply replaced the GIF functions feature-for-feature with PNG functions. That is, you can't do anything with PNG's in GD that you couldn't do with GIF's. Matt

« previous php.general (#27841) next »