At 4:27 PM +0100 4/2/07, Richard Davey wrote:
tedd wrote:
In 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
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.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php