Re: [GD-DEVEL] Anti aliased fonts with transparent backgrounds look crap.
| From: | Pierre Joye | Date: | Wed, 04 Jun 2008 11:35:37 +0000 |
| Subject: | Re: [GD-DEVEL] Anti aliased fonts with transparent backgrounds look crap. | ||
| References: | 1 | Groups: | php.gd.devel |
| Request: | Send a blank email to php-gd-devel+get-443@lists.php.net to get a copy of this message | ||
On Wed, Jun 4, 2008 at 1:30 PM, Steve Davis <steved@hahaha.com.au> wrote:
> Hey Folks,
>
>
>
> I am a bit of a novice with GD but thanks to the web I can manage to cobble
> together what I need to do and am always impressed with the results. GD is
> good!
>
>
>
> I am creating an image from text. I want it to have a transparent
> background
>
>
>
> All good so far except because the text in the image is anti aliased it gets
> some serious jaggies that turn a fantastic looking image into something that
> looks pretty ordinary.
>
>
>
> Is there any solution to this?
This example will surely help you:
http://cvs.php.net/viewvc.cgi/gd/playground/text_on_transparent_background/
> Also I want to do this on the fly with the image being dynamically created
> from database values depending on various paramaters. i.e. it might be
> black text or it might be white. Actually, thinking about it that is really
> the limit, black or white text so that might lead to a kludge solution.
As long as you use the alpha as antialiasing (as in the example
above), you can copy the text on any image. An example of this
technique is shown here:
http://pierre.libgd.org/watermark/ (french text but
codes and iamges
are universal :)
Cheers,
--
Pierre
http://blog.thepimp.net | http://www.libgd.org