GD is an excellent , relatively simple graphics toolkit for creating or modifying graphic images. You may create new images or read in images from several formats to edit or merge. GD contains a number of graphics primitives , objects such as lines and rectangles, which can be added to an image. It also includes support for TrueType fonts. 8.2.1 Installing GDTo install GD.pm on your computer, you should first test to see if the module is already there: try typing perldoc GD to see if the documentation that is installed with the module is running on your computer. If not, GD.pm is available from CPAN, which is the best way to get it (its real home is at http://stein.cshl.org). The GD documentation explains which supporting libraries are necessary. In particular, you need to have Thomas Boutell's gd C library installed, and in the proper version, to work with the version of GD.pm you are installing. To work with different graphics file formats, the gd library is best compiled in the presence of additional libraries that handle PNG, JPEG, zlib compression, and the FreeType version of TrueType fonts. How to obtain and install these additional packages is all explained in the GD documentation. You may need extra time to get these various pieces into place before you can get GD to do everything it can do. So, even if you use CPAN to install GD, the installation requires some information about those additional packages; it's a good idea to look at the documentation first, and to get those libraries in place, before installing GD. To install on my Linux system, I become root and issue the following commands: perl -MCPAN -e shell; cpan> install GD 8.2.2 Using GDThe following list is a partial overview of GD's capabilities:
In sum, GD.pm provides easy-to-program and attractive graphics capabilities for generating dynamic web pages (and for other uses as well). Now that you've had an introduction to the topic of graphics programming, and to the GD.pm module, I'll use GD.pm in a Perl script that generates images dynamically to display restriction maps. |