LibGD is an open source Graphics library for the creation of images dynamically by programmers. GD is written in C, and “wrappers” are available for Perl, PHP and other languages. GD is commonly used to generate charts, graphics, thumbnails, and most anything else, on the fly. While not restricted to use on the web, the most common applications of GD involve website development.

It allows to quickly draw images complete with lines, arcs, text, multiple colors, cut and paste from other images, and flood fills, and write out the result as a PNG or JPEG file.

To use gd in your program, include the file gd.h, and link with the gd library and the other required libraries; the syntax for most Unix flavors is:

-lgd -lpng -lz -ljpeg -lfreetype -lm

GD is written in C Programming Language and various binding are available for different languages like C#, clip. D, Javascript, Lua, Pearl, PHP, Pascal, Python and ruby. The library was originally developed by Thomas Boutell and is now maintained by Pierre-A. Joye under the umbrella of PHP.net.

Home Page: Dynamic Creation of Images

Download: LibGD Releases

Here is a short example program.  (For a more advanced example, see gddemo.c, included in the distribution. gddemo.c is NOT the same program; it demonstrates additional features!)