Review: Programming Web Graphics with Perl & GNU Software
The Scenario
You're an experienced webmaster looking for new ways to present information to your customers. Perhaps you want to create a graph showing hits per hour, or you need to convert all of your GIFs to PNGs, and you know that Perl would be perfect, if only there were a module somewhere.... Or maybe you'd like to write some Perl-Fu, but don't know how to start.
What's Bad?The book seems a little short, for all of the topics presented. I'd have liked to see more examples, but there is a lot of ground to cover, and the references given at the end of each chapter provide places to go for more information.
What's Good? General ImpressionsFor the most part, the information presented is platform-neutral. There is a slight Unix bias, but all of the examples should work with various web servers on most platforms with no modifications. It's also pragmatic -- though the HTML 4.0 specification is mentioned, the author recommends HTML 3.2 until more browsers comply with the 4.0 specification.
The code is very clean and well-commented. Intermediate Perl programmers should have no difficulty following along.
The GIMP is covered thoroughly, with a chapter describing normal operation and basic Perl-Fu, and two Appendixes, a Quick Reference Guide and a Procedure Reference Guide. (Very handy!)
Each chapter lists a handful of references for more information. Think of this book as an introduction to the subjects, and a reference guide after you have the basics down.
Section by Section Intro to Web Graphics
Chapter one, Image File Formats, delves into the three most popular graphics formats used on the web today: GIF, JPEG, and PNG, describing file formats, color options, transparency, animation, and the like. There's a section describing which format is appropriate for which usage, and a small discussion of the LZW patent issue.
Chapter two, Serving Graphics on the Web, looks at the web server and web browser, and their roles in serving and displaying images. This chapter is a kind of overview of the rest of the book, with simple CGI and HTML examples peppering the technical description.
Chapter three, A Litany of Libraries, simply describes several useful free graphics libraries (several of which have their own chapters).
Graphics Programming ToolsThe meat of Programming Web Graphics is in this section. Each chapter focuses on one tool/library, discussing its strengths and giving real-world examples, the bulk of the material is a Nutshell-style listing of methods and data. Much of the book's value is here.
Chapter four, On-the-Fly Graphics with GD, looks at the GD module for standard, quick GIF manipulation.
Chapter five, Industrial-Strength Graphics Scripting with PerlMagick, discusses ImageMagick and PerlMagick, for more complicated (and, more likely, off-line) tasks.
Chapter six, Charts and Graphs with GIFgraph, talks about the GIFgraph module for creating graphs, pie charts, and so forth.
Chapter seven, Web Graphics with the Gimp, delves into the GIMP, with a brief introduction and tutorial. The focus is on two things: using the GIMP to create or to modify web graphics, and creating Perl plug-in scripts for the GIMP.
Dynamic Graphic TechniquesChapter eight, Image Maps, describes server and client side image maps. Example scripts build a "wander engine" (a sort of database-backed set of rooms, traversable with a web browser).
Chapter nine, Moving Pictures: Programming GIF Animation, focuses on the nitty gritty of GIF89a, and describes creating animations with PerlMagick and GIFScript.
Chapter ten, Web Graphics Cookbook, is a sort of catch-all for examples. It provides scripts for a broken image error graphic generator, a robust and secure access counter, JavaScript rollovers, a Web Cam discussion, creating ASCII ALT tags with AAlib, and making thumbnails easily.
Chapter eleven, Paperless Office? Not in Our Lives: Printing and the Web, describes the PostScript language in brief, and documents the PostScript module, paying attention to the GhostScript package.
AppendixesAppendix A, A Simple PNG Decoder in Perl, contains the source to the PNGObject module.
Appendix B, Quick Reference Guide to the Gimp, briefly describes the menus and dialogs of the Gimp.
Appendix C, Procedure Reference for the Gimp, documents the API to the GIMP's internal Procedural Database. Procedures are listed according to their functionality, such as managing images, or working with layers and channels.
So What's In It For Me?If you're a moderately experienced Perl programmer with a web site to play with, and if you're interested in using Perl to make your graphics mastering much easier, pick up this book!
That's a pretty specific audience, but anyone else who has an interest in these things (especially the big three -- GD, PerlMagick, and Perl-Fu) will benefit from the specific chapters and the function references. It's an eclectic book, and there's a lot of information presented. The author has done a tremendous amount of research on lots of different subjects (Generate PostScript receipts from web forms? I never would have guessed), and this book has expanded my ideas of what is possible.
The cover animal is a collared titi, a small South American monkey.
Buy this book at Amazon.
I picked this one up about a month or so ago. I'm just starting to cut my teeth on the llama book, so a good bit of this one is slightly over my head at this point, but I like it nonetheless. Am I the only one who feels like Mel Gibson's character in "Conspiracy Theory" whenever I walk by an ORA bookshelf? I couldn't resist the impulse to pick up Learning Perl/Tk when I walked by it last week. I think it's time to cut up all my credit cards...