Re: [GD-DEVEL] Drawing anti-aliased text with transparent background

From: Date: Sat, 17 Mar 2007 17:32:22 +0000
Subject: Re: [GD-DEVEL] Drawing anti-aliased text with transparent background
References: 1 2 3  Groups: php.gd.devel 
Request: Send a blank email to php-gd-devel+get-135@lists.php.net to get a copy of this message
Hi Andrei, On 3/17/07, Andrei Stebakov <lispercat@gmail.com> wrote:
Pierre, I need to create a png image with a transparent background so that when I put this image on top of any other image of _any_ color only the text will show.
Yes, I understood that. That's why I added the comment about alpha based antialiasing. That's what photoshop or gimp do.
The text outline should look smooth without any fringes. I know when I create a transparent PNG in any graphic program like Photoshop I don't have to pick an anti-aliased color. AFIK, only gif needs a particular color for anti-aliasing. Could you please, enlighten me what we are missing in GD (how it works) and if I can get the result that we are talking about?
Check the list archive, I remember a script to convert the antialias to alpha. The idea is to draw a text using white on a temporary image. Then you can convert the white levels to alpha while copying the temporary image to the final image. I can create a C or PHP example to do it if you like later tonight :). --Pierre

« previous php.gd.devel (#135) next »