CINXE.COM
Turn Text into an Image using the PHP GD Library | bavotasan.com
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US"><head><script type="text/javascript" src="/_static/js/bundle-playback.js?v=HxkREWBo" charset="utf-8"></script> <script type="text/javascript" src="/_static/js/wombat.js?v=txqj7nKC" charset="utf-8"></script> <script>window.RufflePlayer=window.RufflePlayer||{};window.RufflePlayer.config={"autoplay":"on","unmuteOverlay":"hidden"};</script> <script type="text/javascript" src="/_static/js/ruffle/ruffle.js"></script> <script type="text/javascript"> __wm.init("https://web.archive.org/web"); __wm.wombat("http://bavotasan.com:80/tutorials/turn-text-into-an-image-using-the-php-gd-library/","20100707045728","https://web.archive.org/","web","/_static/", "1278478648"); </script> <link rel="stylesheet" type="text/css" href="/_static/css/banner-styles.css?v=S1zqJCYt" /> <link rel="stylesheet" type="text/css" href="/_static/css/iconochive.css?v=3PDvdIFv" /> <!-- End Wayback Rewrite JS Include --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><meta name="googlebot" content="index,archive,follow,noodp"/><meta name="robots" content="all,index,follow"/><meta name="msnbot" content="all,index,follow"/><meta name="description" content="While developing a site for a client, I needed to figure out a way to convert certain text elements into images. I had no clue how to do this but after doi..."/><meta name="keywords" content="browser,client,Clue,Enabled,file,Gd Library,gif files,image,Image Tag,Images,JPEG,library,online,Open,Png,Png File,something,support,tag,Test,text elements,text string,way,"/><title>Turn Text into an Image using the PHP GD Library | bavotasan.com</title><link rel="stylesheet" href="https://web.archive.org/web/20100707045728cs_/http://bavotasan.com/wp-content/themes/bavotasan_new/style.css" type="text/css" media="screen"/><link rel="alternate" type="application/rss+xml" title="bavotasan.com RSS Feed" href="https://web.archive.org/web/20100707045728/http://feeds.feedburner.com/bavotasan"/><link rel="pingback" href="http://bavotasan.com/xmlrpc.php"/> <!--[if IE]><link rel="stylesheet" type="text/css" href="http://bavotasan.com/wp-content/themes/bavotasan_new/iestyles.css" /> <![endif]--> <!--[if IE 8]><link rel="stylesheet" type="text/css" href="http://bavotasan.com/wp-content/themes/bavotasan_new/iestyles8.css" /> <![endif]--><link rel="canonical" href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tutorials/turn-text-into-an-image-using-the-php-gd-library/"/><link rel="alternate" type="application/rss+xml" title="bavotasan.com 禄 Turn Text into an Image using the PHP GD Library Comments Feed" href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tutorials/turn-text-into-an-image-using-the-php-gd-library/feed/"/> <script type="text/javascript" src="https://web.archive.org/web/20100707045728js_/http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js?ver=1.4.2"></script> <link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://bavotasan.com/xmlrpc.php?rsd"/><link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://bavotasan.com/wp-includes/wlwmanifest.xml"/><link rel="index" title="bavotasan.com" href="http://bavotasan.com/"/><link rel="start" title="Removing Images from a WordPress Post: Redux" href="http://bavotasan.com/tutorials/removing-images-from-a-wordpress-post/"/><link rel="prev" title="How to List Your Most Popular Posts in WordPress" href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tutorials/how-to-list-your-most-popular-posts-in-wordpress/"/><link rel="next" title="Absolute and Relative Positions in CSS" href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tutorials/absolute-and-relative-positions-in-css/"/><link rel="canonical" href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tutorials/turn-text-into-an-image-using-the-php-gd-library/"/><link rel="shortlink" href="https://web.archive.org/web/20100707045728/http://wp.me/pmjlM-9B"/> <script type="text/javascript" src="https://web.archive.org/web/20100707045728js_/http://ajax.googleapis.com/ajax/libs/swfobject/2.1/swfobject.js"></script> </head><body> <script type="text/javascript">(function(){var bsa=document.createElement('script');bsa.type='text/javascript';bsa.async=true;bsa.src='//web.archive.org/web/20100707045728/http://s3.buysellads.com/ac/bsa.js';(document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]).appendChild(bsa);})();</script> <div id="topmenu"><ul><li><a href="https://web.archive.org/web/20100707045728/http://themes.bavotasan.com/" title="Themes by bavotasan.com">Themes by bavotasan.com</a></li><li><a href="https://web.archive.org/web/20100707045728/http://support.bavotasan.com/" title="Support Forum">Support Forum</a></li><li><a href="https://web.archive.org/web/20100707045728/http://themes.bavotasan.com/affiliates" title="Affiliates">Affiliates</a></li><li class="page_item page-item-1956"><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/free-premium-theme/" title="Get a Premium Theme for FREE">Get a Premium Theme for FREE</a></li><li class="page_item page-item-943"><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/about/" title="About">About</a></li><li class="page_item page-item-75"><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/services/" title="Services">Services</a></li><li class="page_item page-item-12"><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/contact/" title="Contact">Contact</a></li></ul></div><div id="header"><div id="title"> <a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/" class="bavotasan-logo"></a></div><p id="desc">bavotasan.com by c.bavota</p><div id="navigation"><ul><li><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/">Home</a></li><li class="cat-item cat-item-1 current-cat70"><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/category/articles/" title="View all posts filed under Articles">Articles</a></li><li class="cat-item cat-item-671"><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/category/downloads/" title="View all posts filed under Downloads">Downloads</a></li><li class="cat-item cat-item-1 current-cat"><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/category/tutorials/" title="View all posts filed under Tutorials">Tutorials</a></li></ul></div> <a href="https://web.archive.org/web/20100707045728/http://feeds.feedburner.com/bavotasan" id="newrss"></a></div><div id="mainwrapper"><div class="topround"></div><div id="content"><div id="leftcontent"><div class="post"><h1>Turn Text into an Image using the PHP GD Library</h1><div class="thedate"><span>Posted on May 25, 2009 | Category: <a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/category/tutorials/" title="View all posts in Tutorials" rel="category tag">Tutorials</a></span></div><p>While developing a site for a client, I needed to figure out a way to convert certain text elements into images. I had no clue how to do this but after doing a bit of research, I discovered a nifty library of functions already available through PHP. The GD library offers tons of cools way to dynamically create PNG, JPEG or GIF files and output them directly to your browser, but you need to make sure that your server has the library enabled.</p><p>You can check to see if the GD library available on your server by placing the code:</p><div class="wp_syntax"><table border="0" cellpadding="0" cellspacing="0"><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;"><?php</span> <span style="color: #990000;">phpinfo</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?></span></pre></div></td></tr></table></div><p>into a test.php file and uploading it to your site’s main directory. Open the file online and look to see if GD Support is Enabled. If it is, you are good to go.<br/> <span id="more-595"></span><br/> The following code will dynamically create a PNG file from a text string.</p><div class="wp_syntax"><table border="0" cellpadding="0" cellspacing="0"><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;"><?php</span> <span style="color: #990000;">header</span><span style="color: #009900;">(</span><span style="color: #0000ff;">"Content-type: image/png"</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #000088;">$string</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">"This is my test string."</span><span style="color: #339933;">;</span> <span style="color: #000088;">$font</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span> <span style="color: #000088;">$width</span> <span style="color: #339933;">=</span> <span style="color: #990000;">imagefontwidth</span><span style="color: #009900;">(</span><span style="color: #000088;">$font</span><span style="color: #009900;">)</span> <span style="color: #339933;">*</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">(</span><span style="color: #000088;">$string</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #000088;">$height</span> <span style="color: #339933;">=</span> <span style="color: #990000;">imagefontheight</span><span style="color: #009900;">(</span><span style="color: #000088;">$font</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #000088;">$image</span> <span style="color: #339933;">=</span> <span style="color: #990000;">imagecreatetruecolor</span> <span style="color: #009900;">(</span><span style="color: #000088;">$width</span><span style="color: #339933;">,</span><span style="color: #000088;">$height</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #000088;">$white</span> <span style="color: #339933;">=</span> <span style="color: #990000;">imagecolorallocate</span> <span style="color: #009900;">(</span><span style="color: #000088;">$image</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">255</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">255</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">255</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #000088;">$black</span> <span style="color: #339933;">=</span> <span style="color: #990000;">imagecolorallocate</span> <span style="color: #009900;">(</span><span style="color: #000088;">$image</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #990000;">imagefill</span><span style="color: #009900;">(</span><span style="color: #000088;">$image</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #000088;">$white</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #990000;">imagestring</span> <span style="color: #009900;">(</span><span style="color: #000088;">$image</span><span style="color: #339933;">,</span><span style="color: #000088;">$font</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #000088;">$string</span><span style="color: #339933;">,</span><span style="color: #000088;">$black</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #990000;">imagepng</span> <span style="color: #009900;">(</span><span style="color: #000088;">$image</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #990000;">imagedestroy</span><span style="color: #009900;">(</span><span style="color: #000088;">$image</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?></span></pre></div></td></tr></table></div><p>The above code must be included in its own file, it cannot be added to an existing PHP file with other functions. To access this image from another file just include it as the source in an image tag.</p><p>Test out turning text into an image by typing in something below.</p><form method="get" action="https://web.archive.org/web/20100707045728/http://bavotasan.com/text-to-image.php"> <input type="text" name="text" maxlength="40" size="40"/> <input type="submit" name="submit" value="Text to Image"/></form> <br style="clear:both;"/><hr class="clear"/><p class="tags">Tags: <a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tag/browser/" rel="tag">browser</a>, <a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tag/client/" rel="tag">client</a>, <a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tag/clue/" rel="tag">Clue</a>, <a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tag/enabled/" rel="tag">Enabled</a>, <a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tag/file/" rel="tag">file</a>, <a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tag/gd-library/" rel="tag">Gd Library</a>, <a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tag/gif-files/" rel="tag">gif files</a>, <a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tag/image/" rel="tag">image</a>, <a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tag/image-tag/" rel="tag">Image Tag</a>, <a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tag/images/" rel="tag">Images</a>, <a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tag/jpeg/" rel="tag">JPEG</a>, <a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tag/library/" rel="tag">library</a>, <a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tag/online/" rel="tag">online</a>, <a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tag/open/" rel="tag">Open</a>, <a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tag/png/" rel="tag">Png</a>, <a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tag/png-file/" rel="tag">Png File</a>, <a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tag/something/" rel="tag">something</a>, <a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tag/support/" rel="tag">support</a>, <a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tag/tag/" rel="tag">tag</a>, <a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tag/test/" rel="tag">Test</a>, <a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tag/text-elements/" rel="tag">text elements</a>, <a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tag/text-string/" rel="tag">text string</a>, <a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tag/way/" rel="tag">way</a></p><p class="tags">Short URL: <a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/?p=595" title="Turn Text into an Image using the PHP GD Library">http://bavotasan.com/?p=595</a></p></div><div class="lowerposts"><div class="leftlower"><h3>Did you like this?</h3><div class="rss"></div><a href="https://web.archive.org/web/20100707045728/http://feeds.feedburner.com/bavotasan">Subscribe and get the latest</a><br/> <a class="a2a_dd addtoany_share_save" href="https://web.archive.org/web/20100707045728/http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fbavotasan.com%2Ftutorials%2Fturn-text-into-an-image-using-the-php-gd-library%2F&linkname=Turn%20Text%20into%20an%20Image%20using%20the%20PHP%20GD%20Library"><img src="https://web.archive.org/web/20100707045728im_/http://bavotasan.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> <script type="text/javascript">var a2a_config=a2a_config||{};a2a_config.linkname="Turn Text into an Image using the PHP GD Library";a2a_config.linkurl="https://web.archive.org/web/20100707045728/http://bavotasan.com/tutorials/turn-text-into-an-image-using-the-php-gd-library/";</script><script type="text/javascript" src="https://web.archive.org/web/20100707045728js_/http://static.addtoany.com/menu/page.js"></script> <div class="share"> <script src="https://web.archive.org/web/20100707045728js_/http://digg.com/tools/diggthis.js" type="text/javascript"></script> <div class="tweet"><script type="text/javascript" src="https://web.archive.org/web/20100707045728js_/http://tweetmeme.com/i/scripts/button.js"></script></div></div></div><div class="rightlower"><div id="crp_related"><h3>Similar Posts</h3><ul><li><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tutorials/processing-multiple-forms-on-one-page-with-php/" rel="bookmark" class="crp_title">Processing Multiple Forms on One Page with PHP</a></li><li><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tutorials/getting-text-in-your-wordpress-search-box/" rel="bookmark" class="crp_title">Getting Text in your WordPress Search Box</a></li><li><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tutorials/removing-extraneous-backslashes-with-php/" rel="bookmark" class="crp_title">Removing Extraneous Backslashes with PHP</a></li><li><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tutorials/using-php-to-remove-an-html-tag-from-a-string/" rel="bookmark" class="crp_title">Using PHP to Remove an HTML Tag from a String</a></li><li><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tutorials/how-to-upload-zip-file-using-php/" rel="bookmark" class="crp_title">How to Upload and Unpack a Zip File using PHP</a></li></ul></div></div></div><div id="postcomments"> <a href="#comment_list"></a><h3 id="comments">4 Responses to “Turn Text into an Image using the PHP GD Library”</h3><div class="navigation"><div class="alignleft"></div><div class="alignright"></div></div><ol class="commentlist"><li class="comment even thread-even depth-1" id="li-comment-3051"><div id="comment-3051"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100707045728im_/http://0.gravatar.com/avatar/6630c73afdedf9e7c8500abca59b5bb6?s=36&d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn">dreamer</cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tutorials/turn-text-into-an-image-using-the-php-gd-library/comment-page-1/#comment-3051"> June 24, 2009 at 10:05 am</a></div><p>great! thank you. however; what about the utf 8? out of english characters?</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100707045728/http://bavotasan.com/tutorials/turn-text-into-an-image-using-the-php-gd-library/?replytocom=3051#respond" onclick="return addComment.moveForm("comment-3051", "3051", "respond", "595")">Reply</a></div><div class="commentnumber">#3051</div></div></li><li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-3339"><div id="comment-3339"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100707045728im_/http://1.gravatar.com/avatar/3556d5c5ad02eed921f5ebcab6e683db?s=36&d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100707045728/http://relivingfor30days.com/" rel="external nofollow" class="url">Debra</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tutorials/turn-text-into-an-image-using-the-php-gd-library/comment-page-1/#comment-3339"> July 14, 2009 at 9:57 am</a></div><p>I am having trouble creating the image for the advertisement at the top of the magazine basic. There is no browse and select jpg or anything. When I type text nothing shows up either. Do you just need to add the above text to a file and refer to it somehow. Please advise.</p><p>Thanks</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100707045728/http://bavotasan.com/tutorials/turn-text-into-an-image-using-the-php-gd-library/?replytocom=3339#respond" onclick="return addComment.moveForm("comment-3339", "3339", "respond", "595")">Reply</a></div><div class="commentnumber">#3339</div></div><ul class="children"><li class="comment byuser bypostauthor even depth-2" id="li-comment-3359"><div id="comment-3359"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100707045728im_/http://0.gravatar.com/avatar/0375e723bd400a99acb6f2e08d6ea190?s=36&d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100707045728/http://tinkerpriestmedia.com/" rel="external nofollow" class="url">c.bavota</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tutorials/turn-text-into-an-image-using-the-php-gd-library/comment-page-1/#comment-3359"> July 16, 2009 at 11:53 pm</a></div><p>Your comment is on the wrong page. To add an ad, you need to place an image link and a link. You need to upload your image either through FTP or the WordPress uploader.</p><div class="commentnumber">#3359</div></div></li></ul></li><li class="comment odd alt thread-even depth-1" id="li-comment-4651"><div id="comment-4651"><div class="comment-author vcard"> <img alt="" src="https://web.archive.org/web/20100707045728im_/http://0.gravatar.com/avatar/4c9f1ab2e2f1008fe3e7e4aee5758520?s=36&d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D36&r=G" class="avatar avatar-36 photo" height="36" width="36"/><cite class="fn"><a href="https://web.archive.org/web/20100707045728/http://n/A" rel="external nofollow" class="url">Johnny</a></cite></div><div class="comment-meta commentmetadata"><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tutorials/turn-text-into-an-image-using-the-php-gd-library/comment-page-1/#comment-4651"> September 18, 2009 at 4:11 pm</a></div><p>Hi<br/> Is there some nifty way you can make this dynamically update based on a text string in e.g. a forum?<br/> I would like it to be used to include a text in an avatar I use on a forum, so it would be superb if it could pull the text from the forum where I have my public profile.</p><div class="reply"> <a rel="nofollow" class="comment-reply-link" href="/web/20100707045728/http://bavotasan.com/tutorials/turn-text-into-an-image-using-the-php-gd-library/?replytocom=4651#respond" onclick="return addComment.moveForm("comment-4651", "4651", "respond", "595")">Reply</a></div><div class="commentnumber">#4651</div></div></li></ol><div class="navigation"><div class="alignleft"></div><div class="alignright"></div></div><div id="respond"><h3>Leave a Reply</h3><div class="cancel-comment-reply"> <a rel="nofollow" id="cancel-comment-reply-link" href="/web/20100707045728/http://bavotasan.com/tutorials/turn-text-into-an-image-using-the-php-gd-library/#respond" style="display:none;">Click here to cancel reply.</a></div><form action="https://web.archive.org/web/20100707045728/http://bavotasan.com/wp-comments-post.php" method="post" id="commentform"><p><input type="text" name="author" id="author" value="" size="22" tabindex="1"/> <label for="author"><small>Name (required)</small></label></p><p><input type="text" name="email" id="email" value="" size="22" tabindex="2"/> <label for="email"><small>Mail (will not be published) (required)</small></label></p><p><input type="text" name="url" id="url" value="" size="22" tabindex="3"/> <label for="url"><small>Website</small></label></p><p>To enter code in the comment box, please place it between <strong><pre lang="php"> </pre></strong> tags. You don't have to convert any characters to their hex/HTML code. Just add your code the way you would to any code editor.</p><p><textarea name="comment" id="comment" cols="" rows="10" tabindex="4"></textarea></p><p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment"/> <input type="hidden" name="comment_post_ID" value="595" id="comment_post_ID"/> <input type="hidden" name="comment_parent" id="comment_parent" value="0"/></p></form></div></div></div><div id="sidebar"><div id="search"><form method="get" id="searchform" action="https://web.archive.org/web/20100707045728/http://bavotasan.com/"><div> <input type="text" class="search_input" value="To Search, Type & Hit Enter" name="s" id="s" onfocus="if (this.value == 'To Search, Type & Hit Enter') {this.value = '';}" onblur="if (this.value == '') {this.value = 'To Search, Type & Hit Enter';}"/> <input type="hidden" id="searchsubmit" value="Search"/></div></form><div class="arrow"></div></div><div id="sideads"> <a href="https://web.archive.org/web/20100707045728/http://themes.bavotasan.com/"><img src="https://web.archive.org/web/20100707045728im_/http://bavotasan.com/images/themes.png" alt="Themes by bavotasan.com" class="sideads" style="margin-bottom: 8px;" width="270" height="250"/></a><div id="bsap_1237633" class="bsarocks bsap_8982c17d635c33dbe23a7ef930777c37"></div><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/downloads/delete-duplicate-posts-pro-wordpress-plugin/?xyz=1"><img src="https://web.archive.org/web/20100707045728im_/http://bavotasan.com/wp-content/themes/bavotasan_new/images/ddp-ad.png" class="sideads" alt="Delete Duplicate Posts Pro" width="125" height="125"/></a> <a href="https://web.archive.org/web/20100707045728/https://www.e-junkie.com/ecom/gb.php?cl=88539&c=ib&aff=93121"><img src="https://web.archive.org/web/20100707045728im_/http://bavotasan.com/wp-content/themes/bavotasan_new/images/diggword.png" alt="Digging into WordPress" class="sideads" width="125" height="125"/></a> <a href="https://web.archive.org/web/20100707045728/https://www.e-junkie.com/ecom/gb.php?cl=94455&c=ib&aff=93121" target="ejejcsingle"><img src="https://web.archive.org/web/20100707045728im_/http://bavotasan.com/images/WP-Defender-Cover2.jpg" alt="WordPress Defender" width="125" height="125" class="sideads"/></a> <a href="https://web.archive.org/web/20100707045728/https://secure1.inmotionhosting.com/cgi-bin/gby/clickthru.cgi?id=tinkerpriest&page=7"><img src="https://web.archive.org/web/20100707045728im_/http://creatives.inmotionhosting.com/125x125.v6.gif" class="sideads" width="125" height="125"/></a><div id="bsap_1237624" class="bsarocks bsap_8982c17d635c33dbe23a7ef930777c37"></div><hr style="clear:both;height: 0;border:0;"/></div><div id="popular"><h2>Most Popular Posts</h2><ul class="wppp_list"><li><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tutorials/creating-a-jquery-mouseover-fade-effect/" title="Creating a Mouseover Fade Effect with jQuery ">Creating a Mouseover Fade Effect with jQuery </a></li><li><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tutorials/a-simple-mouseover-hover-effect-with-jquery/" title="A Simple Mouseover Hover Effect with jQuery">A Simple Mouseover Hover Effect with jQuery</a></li><li><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/downloads/magazine-basic-free-wordpress-theme/" title="Magazine Basic v2.6 WordPress Theme">Magazine Basic v2.6 WordPress Theme</a></li><li><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/downloads/full-sizebackground-image-jquery-plugin/" title="Full Size Background Image jQuery Plugin">Full Size Background Image jQuery Plugin</a></li><li><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/downloads/easy-overlay-modal-window-jquery-plugin/" title="Easy Overlay Modal Window jQuery Plugin">Easy Overlay Modal Window jQuery Plugin</a></li><li><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tutorials/processing-multiple-forms-on-one-page-with-php/" title="Processing Multiple Forms on One Page with PHP">Processing Multiple Forms on One Page with PHP</a></li><li><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tutorials/limiting-the-number-of-words-in-your-excerpt-or-content-in-wordpress/" title="Excerpt or Content Word Limit in WordPress: Redux">Excerpt or Content Word Limit in WordPress: Redux</a></li><li><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tutorials/retrieve-the-first-image-from-a-wordpress-post/" title="Retrieve and Display Images from a WordPress Post">Retrieve and Display Images from a WordPress Post</a></li><li><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tutorials/remove-the-title-attribute-from-wordpress-category-and-page-lists/" title="Remove the Title Attribute from WordPress Category and Page Lists">Remove the Title Attribute from WordPress Category and Page Lists</a></li><li><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tutorials/wordpress-3-checking-out-the-new-menu-system/" title="WordPress 3.0: Checking out the New Menu System">WordPress 3.0: Checking out the New Menu System</a></li></ul></div><div id="freewordpress"><h2>Get a Premium Theme for FREE</h2><p><a href="https://web.archive.org/web/20100707045728/https://secure1.inmotionhosting.com/cgi-bin/gby/clickthru.cgi?id=tinkerpriest" class="wordpress-logo"></a><strong>Don't have a Web site?</strong> How would you like to have WordPress and a <a href="https://web.archive.org/web/20100707045728/http://themes.bavotasan.com/category/premium-themes">Themes by bavotasan.com</a> Premium theme installed and configured for <em>FREE</em>? All you need to do is <a href="https://web.archive.org/web/20100707045728/https://secure1.inmotionhosting.com/cgi-bin/gby/clickthru.cgi?id=tinkerpriest">sign up with InMotion Hosting through this link</a>. <br/> <br/> <a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/free-premium-theme/">Click here for more information »</a></p></div><div id="donate"><h2>Support c.bavota</h2><p>If you would like to support <a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/">c.bavota</a> and <a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/">bavotasan.com</a>, please use the donate link below. Any amount, even $1.00, is appreciated (a man's gotta eat, ya know).</p><form action="https://web.archive.org/web/20100707045728/https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_s-xclick"/> <input type="hidden" name="hosted_button_id" value="5745952"/> <input type="image" src="https://web.archive.org/web/20100707045728im_/https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" name="submit" alt="PayPal - The safer, easier way to pay online!"/> <img alt="" border="0" src="https://web.archive.org/web/20100707045728im_/https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"/></form></div> <a href="https://web.archive.org/web/20100707045728/http://mediatemple.net/" class="mediatemplate"></a></div></div></div><div id="footer"><div id="sitemap"><div id="wrap"><div class="col1"><h2>Stay in tune</h2><div class="tweets"></div> <br class="clear"/><div class="twitter-bird"></div><a href="https://web.archive.org/web/20100707045728/http://twitter.com/bavotasan" class="follow"><em>Follow Me on Twitter!</em></a></div><div class="col2"><h2>Downloads</h2><ul><li><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/downloads/feed-me-seymour-free-wordpress-theme/">Feed Me, Seymour 1.2</a></li><li><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/downloads/magazine-basic-free-wordpress-theme/">Magazine Basic v2.6 WordPress Theme</a></li><li><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/downloads/sliderota-jquery-plugin/">Sliderota jQuery Plugin</a></li><li><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/downloads/full-sizebackground-image-jquery-plugin/">Full Size Background Image jQuery Plugin</a></li><li><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/downloads/easy-overlay-modal-window-jquery-plugin/">Easy Overlay Modal Window jQuery Plugin</a></li><li><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/downloads/snowblind-free-wordpress-theme/">Snowblind v1.1.2 Free WordPress Theme</a></li><li><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/downloads/8-free-colorful-background-textures-for-designers/">8 Free Colorful Background Textures for Designers</a></li></ul></div><div class="col3"><h2>Tutorials</h2><ul><li><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tutorials/scrolling-back-to-top-button-jquery/">Creating a Scrolling Back to Top Button with jQuery</a></li><li><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tutorials/get_theme_data-developing-custom-theme-wordpress/">Using get_theme_data() when Developing a Custom Theme for WordPress</a></li><li><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tutorials/define-constant-php/">Defining a Constant with PHP</a></li><li><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tutorials/wordpress-3-activating-background-editor/">WordPress 3.0: Activating the Background Editor</a></li><li><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tutorials/wordpress-3-creating-multi-user-web-sites/">WordPress 3.0: Creating Multi-User Web Sites</a></li><li><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tutorials/wordpress-3-checking-out-the-new-menu-system/">WordPress 3.0: Checking out the New Menu System</a></li><li><a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/tutorials/how-to-upload-zip-file-using-php/">How to Upload and Unpack a Zip File using PHP</a></li></ul></div></div></div> <span class="footerleft">Copyright © 2010 <a href="https://web.archive.org/web/20100707045728/http://bavotasan.com/">bavotasan.com</a>. All Rights Reserved. Powered by <a href="https://web.archive.org/web/20100707045728/http://www.wordpress.org/">WordPress</a>.</span><div class="toparrow"></div><span class="backtotop">Back to Top</span></div> <script src="https://web.archive.org/web/20100707045728js_/http://stats.wordpress.com/e-201027.js" type="text/javascript"></script> <script type="text/javascript">st_go({blog:'5317602',v:'ext',post:'595'});var load_cmc=function(){linktracker_init(5317602,595,2);};if(typeof addLoadEvent!='undefined')addLoadEvent(load_cmc);else load_cmc();</script> <script type="text/javascript" src="https://web.archive.org/web/20100707045728js_/http://bavotasan.com/wp-content/themes/bavotasan_new/js/coolstuff.js"></script> <script type="text/javascript">hs.graphicsDir='https://web.archive.org/web/20100707045728/http://bavotasan.com/wp-content/plugins/highslide-integration/highslide/graphics/';hs.outlineType='rounded-white';hs.outlineWhileAnimating=true;</script> <script type="text/javascript">var gaJsHost=(("https:"==document.location.protocol)?"https://web.archive.org/web/20100707045728/https://ssl.":"https://web.archive.org/web/20100707045728/http://www.");document.write(unescape("%3Cscript src='"+gaJsHost+"google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));</script> <script type="text/javascript">try{var pageTracker=_gat._getTracker("UA-452133-5");pageTracker._trackPageview();}catch(err){}</script> </body></html> <!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/ Minified using disk Page Caching using disk (user agent is rejected) Database Caching 44/61 queries in 0.093 seconds using disk Served from: bavotasan.com @ 2010-07-07 04:57:28 --><!-- FILE ARCHIVED ON 04:57:28 Jul 07, 2010 AND RETRIEVED FROM THE INTERNET ARCHIVE ON 21:50:36 Nov 29, 2024. JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). --> <!-- playback timings (ms): captures_list: 0.704 exclusion.robots: 0.039 exclusion.robots.policy: 0.024 esindex: 0.012 cdx.remote: 7.567 LoadShardBlock: 300.973 (3) PetaboxLoader3.datanode: 106.366 (4) PetaboxLoader3.resolve: 124.934 (2) load_resource: 154.336 -->