Re: imagecreate() question

From: Date: Mon, 02 Apr 2007 17:59:59 +0000
Subject: Re: imagecreate() question
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-251944@lists.php.net to get a copy of this message
Did you try making it transparent first, before adding the circle? Only a question because I'm not sure if it will make a difference. I know I had problems trying to get the alpha blending to actually look decent in png's (ended up looking like a very poor gif with a non-antialiased mask) and I think I eventually gave up and put the image on a white background. But that was six months to a year ago and anything more than two weeks out is all but forgotten, old-timers disease I think. Ed On Apr 2, 2007, at 12:26 PM, tedd wrote:
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


« previous php.general (#251944) next »