Re: [GD-DEVEL] Drawing anti-aliased text with transparent background
[email protected] (Pierre)
| Newsgroups | php.gd.devel |
|---|---|
| Message-ID | <[email protected]> |
On 3/18/07, Pierre <[email protected]> wrote: > HI Ethan, > > On 3/18/07, Ethan A Merritt <[email protected]> wrote: > > On Saturday 17 March 2007 11:54, Pierre wrote: > > > On 3/17/07, Andrei Stebakov <[email protected]> wrote: > > > > My goal is to create a .png image that has some text on a transparent > > > > background. > > > > > > Here you go: > > > > > > and the code: > > > http://cvs.php.net/viewvc.cgi/gd/playground/text_on_transparent_background/text_aa_alpha.c?revision=1.2&view=markup > > > > > > Please remember that it will work for text but not other shapes. The > > > antialiased lines always blend on the destination pixel, for now. > > > > Aha. That explains something that had been bothering me about some > > plots created by gnuplot. So if the user chooses TrueColor output and > > a transparent background, > > Please note that in my example it is a not the transparent color has a > maximum alpha (gdAlphaTransparent). Oops. Let me try again. It is not the transparent color or color index. The color of the pixels where the text is drawn is not opaque (alpha > 0). That's also good fun to get nice results when the destination pixels are not fully opaque or transparent, 127 distinct levels are not enough. --Pierre