RE: [PHP] How to add a new color to JPEG

From: Date: Tue, 17 Jul 2001 17:01:38 +0000
Subject: RE: [PHP] How to add a new color to JPEG
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-58294@lists.php.net to get a copy of this message
I don't know a way around the problem you're describing with your version of PHP, but PHP 4.0.6 with GD 2.0.1 allows you to call ImageCreateTrueColor(), which eliminates the 256-color limitation with JPEG files-- solved my problem right away. -----Original Message----- From: Jennifer [mailto:toxlists@canada.com] Sent: Tuesday, July 17, 2001 5:55 AM To: php-general@lists.php.net Subject: Re: [PHP] How to add a new color to JPEG > > > -----Original Message----- > > > From: SED [mailto:sed@sed.is] > > > According to the manual, you can only get closest value of your > > > desired color by letting the ImageColorClosest() find it. > > > Therefore, if the image is totally black, you can not get the > > > yellow color. I have not found a way to do this though I believe I > > > have tried everything. And yet, I have not found any documents > > > covering this other than PHP-manual. I didn't get this from reading the manual, but I struggled with this problem for days and finally gave up. I posted to some other forums when this one was done and found no answers. Now, I know it isn't just me and I know what the problem is, but I still don't know a solution. I am creating an image on the fly and I have no problem if I am just using a background color and adding text to it or if I use ImageCreateFromPNG, but if I use ImageCreateFromJPEG and try to add text on top of that or even a rectangle or anything on top, it seems to ignore the color that I specify and always came out grey. (Of course now if I use ImageColorClosest(), some colors work because they are in my image.) It doesn't matter what I output it as, only what I read it in as. And if I read it in as a png, the image quality is horrible which I also don't understand. It seems to have drastically reduced the number of colors used. My phphinfo says GD version 1.6.2 or higher I'm using PHP Version 4.0.1pl2 Here is my test page. http://216.122.251.174/test/test.php Here is the source for the graphic http://216.122.251.174/test/button.phps Any idea on how solutions? Jennifer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#58294) next »