|Perl Monk, Perl Meditation|
Graphics Programming with Perl
Graphics Programming with Perl was written to be "a guide to the graphics and imaging modules and tools available to the Perl programmer." Martien Verbruggen, author of GD::Graph and GD::Text modules, has met this goal head on by providing a very clear and concise look at many of the popular modules for creating and manipulating graphics with Perl.
The title of the book gives away its purpose but can be a bit misleading. The goal of the book is not to be a complete reference but more of a starting point for those new to graphics programming with Perl. This is not a book from which to learn Perl or graphics theory. This is a book to introduce graphics manipulation from a Perl point of view.
"Graphics Programming with Perl" is divided into four parts: Foundations, Creating Graphics, Special Topics, and the Appendices.
In part one, Foundations, Verbruggen reviews the fundamentals of graphics programming, discusses the common graphics file formats, and previews the modules and tools that will be discussed later in the book. Example code first shows up in Chapter 2 during a discussion of image sizes and formats. I found the modules and tools preview in Chapter 3 very useful as it will save time searching through the book at a later date. Part one offers a wonderful introduction to graphics for the beginning graphics programmer.
Part two focuses on the creation of graphics: drawings, charts or graphs, and three-dimensional images. GD and Image::Magick are used extensively in this section of the book. Verbruggen has offered many real-world examples, including thumbnails, charts, web photo albums, and simple animations. Although the GIMP is not discussed in full detail, the author makes reference to the GIMP (http://www.gimp.org) and offers an example of creating an animation. Several links are offered for further study. Part two parades some of the many topics concerning creation of graphics with Perl. One of the topics I would like to have seen discussed more in part two is SVG (Scalable Vector Graphics). SVG is mentioned several times in the book; however, no examples are offered.
Part three is an interesting collection of topics, writing graphics modules, text placement, and pixel manipulation and transparency. Chapter 10, Writing Your Own Graphics Module, points out advantages of OO within graphics programming. Being that Verbruggen authored the GD::Text modules, Chapter 11, Controlling Text Placement, is handled very well. Chapter 12 cooks up a stew of topics, including pixels, PDL (Perl Data Language), and even processing in C.
I enjoyed reading Graphics Programming with Perl. The author handled a large set of topics very well, focusing on key points and discussing pitfalls that might be encountered when using the different tools. For instance, Verbruggen's experience shines through when he mentions the API changes to the modules and tools being discussed. The code examples are great (I especially enjoyed the bullets labeling the code), though it seems some of the examples are broken due to the afore mentioned API changes. The author does a wonderful job of providing references to other works, online documents, and module documentation. Two topics I think deserve more coverage are SVG and PDL, possibly in a second edition. I recommend this book to anyone who has experience with Perl and is just getting started with graphics programming.
Edit by tye