Re: imagecreate() question
| From: | tedd | Date: | Mon, 02 Apr 2007 17:26:58 +0000 |
| Subject: | Re: imagecreate() question | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-251942@lists.php.net to get a copy of this message | ||
At 4:27 PM +0100 4/2/07, Richard Davey wrote:
tedd wrote:I found, which generated my questions, that the difference between a "blank" page and a "black" page can be significant when dealing with alpha channels. For example, if I create a "blank" page and then place a 50 percent transparent circle on it, it works. However if I do the same thing using a "black" page and change the color black to transparent, I lose the 50 percent transparency of the circle. In other words, it generates a transparent page with a nontransparent circle. If anyone knows how to use imagecreatetruecolor() to create a png image that has a 100% transparent background with a 50% transparent circle on it, I sure would like to see how you did it. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.comIn the php manual it says: imagecreate() returns an image identifier representing a blank image of specified size. We recommend the use of imagecreatetruecolor(). Q: Why the recommendation?Because the need to create 256 colour (or less) images grows less year by year. If you need to work with a jpeg/png then imagecreatetruecolor() is required. As this is what most people need, hence the manual comment exists.imagecreate() returns a "blank" page whereas imagecreatetruecolor() returns a "black" page.Sure, but both are easily changed. Cheers, Rich