August 7th, 2007

How to create an image from text with PHP

At some point or other, pretty much every web developer has wondered if there's an easy way to create an image from a text variable in PHP. There are many potential uses for this, the simplest of which being aesthetics. A heading rendered as a JPEG or GIF can make use of anti-aliasing for the edges of the text, so it will look much smoother and more refined, as opposed to a basic text/HTML heading which can be somewhat crispy.

Here's a link to a PHP class that will allow you to do this image rendering easily.

Leave a reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture.
Anti-Spam Image