Slashdot Mirror


Review: Programming Web Graphics with Perl & GNU Software

Thanks to chromatic, who has returned with another book review. This time around it's O'Reilly's Programming Web Graphics with Perl & GNU Software. Excellent book for prospective Webmasters - give it a look. Programming Web Graphics with Perl & GNU Software author Shawn P. Wallace pages 441 publisher O'Reilly rating 8/10 reviewer chromatic ISBN summary If you want to spice up your website with graphics generated on the fly or automate graphic manipulation tasks with Perl, Shawn Wallace points you in the right direction and gives you the tools you'll need to hone your skills.

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 Impressions

For 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 Tools

The 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 Techniques

Chapter 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.

Appendixes

Appendix 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.

20 comments

  1. Not bad by Anonymous Coward · · Score: 0

    Doesn't look too bad, but I'll stick to what I know. ------ First post???!! PLEASE!

  2. Installing all the libaries is a pain in the ass by Anonymous Coward · · Score: 0

    I really like the book and uses a lot of their examples to create nice features for websites, but since various libaries an applications are needed, you need a lot of time to install everything...

  3. h0h0 by Anonymous Coward · · Score: 0

    Looks like chater 4 is obsolete now... On another note, why is there a gardening link listed above the comment section?

    1. Re:h0h0 by Tony+Shepps · · Score: 1

      The GD library has been updated to work with PNGs instead of GIFs, so some of that information is probably still useful.

  4. Re:Catcher in the Rye by Anonymous Coward · · Score: 0

    >Am I the only one who feels like Mel Gibson's
    >character in "Conspiracy Theory" whenever I walk
    >by an ORA bookshelf?

    Oh yes I know what you mean, I just can't resist
    those nice animals. They are like an addiction!

    I still have two Perlbooks ( Camel and Cookbook),
    1 Javascript and 1 make book on my shelf I have
    never touched so far. Plus some other non O'Reilly
    books about kernel 2.2 and xemacs-lisp and gawk.

    I just love computer books and espescially ORA
    books

    I have a hard time to resist every time when I
    walk by one of those.

  5. Re:Installing all the libaries is a pain in the as by Anonymous Coward · · Score: 0

    That's probably true, but then again, if you're going to learn the content of the book, the amount of time taken to install the libraries is probably negligible against the time that you should be spending with the book to honestly learn the material. There are always redhat powertools CPAN RPMs, too.

  6. Bad Title: How is GD GNU Software? by Anonymous Coward · · Score: 0

    The book's title refers to using Perl and GNU software. One of the big three items discussed is GD. Can someone tell me, how is GD GNU software? The GD license does not seem to be compatible with the GPL. The copyright has an advertising clause requiring credit be given to the authors and makes no mention of permission for distributing modifications. (But it does make mention of permission for distributing the software itself.) I don't see GD listed on gnu.org's web page as part of GNU software. A search for GD turns up nothing there. Isn't GD Boutell.Com software? It appears to me that O'Reilly badly titled this book, and for what purpose? What would have been wrong with using something like "Free Source" instead of "GNU Software"?

    1. Re:Bad Title: How is GD GNU Software? by Anonymous Coward · · Score: 0

      i think "perl AND gnu software" is the thing that makes the difference, it doesn't say that you use GNU software for everything right? It's like ORA's "writing apache modules with perl and c", noone would complain about that and say "aww, none of these examples use C and Perl together!". Really though, this is the kind of semantics issue that really makes no difference to anything whatsoever, I can't believe I'm even replying.

  7. Powell's Technical is the Pit of Hell by Anonymous Coward · · Score: 0

    As far as my credit rating is concerned!!!!

    Seriously, my last gig let me expense whatever tech books I wanted. The folks at Powell's started recognizing me when I walked in the door. That's about the ONLY thing I missed about that job.

  8. Re:General Comment by Anonymous Coward · · Score: 0

    is this flamebait? or just really vague? inapplicable to what? the job at hand, or you just don't have a need for them? I've never read a bad oreilly really, some I have gotten and then realized I didn't need as bad as I thought for a given job, but that's about it.

  9. Re:General Comment by Doug+McNaught · · Score: 1

    Then you obviously don't do much with Sendmail, BIND, HTML, or a bunch of other stuff.

    I'm sure there are some sub-par ones (I've never read any of the NT-related titles) but all the ORA books I've read/bought have been well worth the price.

    Furrfu...

  10. Re:General Comment by Dom2 · · Score: 1

    I loved your motif book. However, I still find Motif in general to be too much hassle... The other problem is that once I'd started looking into it, I found I needed a custom widget for my app. So I bought vol 3. Then, I found I needed to know more about Xlib than I thought to do that. So now I have to go and buy vol 1. I just hope I don't have to buy vol 0 at the end!!!

  11. Just when you thought you had all the Perl books.. by VAXGeek · · Score: 1

    Another $39.99 book comes out :(

    I know where my check is going......

    -VaxGeek

    --
    this sig limit is too small to put anything good h
  12. Re:Catcher in the Rye by chromatic · · Score: 1


    I felt the same way when I picked up this one, actually. If you're ever in the Portland, Oregon area, stay away from Powell's Technical books.

    Okay, go. Just be aware that you'll find lots of stuff to buy, and prices are pretty good. Then send Slashdot a couple of bucks. (Is that okay to say, Hemos?)

    --
    QDMerge 0.21!

  13. Catcher in the Rye by Anti-Sean · · Score: 2

    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...

  14. Perl Script that Draws a Camel. by MikeA · · Score: 1

    The only question is one hump or two?

  15. Looks like a good book. by thal · · Score: 1

    I went through the horrible pain known as learning Scheme and Script-Fu simulatenously to do scripts for The Gimp a few months ago. I'm really excited to know that there is some good documentation on Gimp scripting and especially Perl-Fu (Perl being a much easier language to work with, at least if you have a C background), considering it is still in the development release. This sounds like it's just the thing that non-artistic programmers need to make a site with interesting visuals.

  16. Only $17.97 on Amazon by jeddz · · Score: 1

    $17.97 on Amazon! Woo-hoo!

    --jeddz

  17. Re:General Comment by RenaissanceBug · · Score: 1

    Well, I can sympathize with the problem of not really needing the books, and yes, just about all the ORA books I've bought and read so far are good ones, but there are occasionally a few problems that seem to slip by the staff--what comes to mind right away is Advanced Perl Programming, which (in spite of being a conceptually great, and well-designed, tutorial) has some errors in references to code examples (and errors in code examples) and the like that just shouldn't have made it past a crack editorial staff.




    *shrug* Chalk it up to deadlines, I guess...

    --
    -- (if I were a bug, I would want to be a true Renaissance Bug)
  18. Re:General Comment by argv[0] · · Score: 1

    > I really don't understand how the other
    > O'Reilly books can have any popularity

    I don't know...I think the ORA book on Motif Programming is pretty good. :-}

    --
    --dan www.danheller.com