Preface

Welcome to Perl Graphics Programming! This book is kind of a second, expanded edition of Programming Web Graphics, which was published in 1999. That book focused solely on the PNG, JPEG, and GIF image formats, and was intended more for web applications programmers than for Perl programmers. This book still has a heavy slant toward web applications, but it has been rewritten to fit in better with the other “applied Perl” books. The scope has also been expanded to include the SVG and SWF vector image formats. Intermediate-level Perl users will probably get the most out of this book, though hopefully it will demystify the manipulation of graphics files for newcomers as well.

Perl Graphics Programming takes a practical, resource-based approach to the material. Each section starts with a tour of the internals of the file format in question, followed by a tutorial and reference for one of the popular free Perl libraries or applications that implement the format. The reference sections are more than a generic rehash of the perldoc pages. In some cases, the reference material supplements existing documentation, and in some cases it provides help where the existing documentation is inadequate. Throughout, I have tried to anticipate the questions that a newcomer to the material might ask.

The software covered in this book includes:

  • GD and GD::Graph, for creating indexed raster graphics

  • ImageMagick, for handling a wide range of image formats

  • The Gimp, for specialized image manipulation tasks and filters

  • Various Perl XML tools, for SVG files

  • Ming, for creating SWF (Flash) movies

  • Ghostscript and the PostScript modules, for PostScript files

  • The PDF::API2 module, for PDF documents

The focus is always on free software, when it is available. Some fine software has been prominently overlooked (PDFlib in particular) because it is not available under a free license. Some software (such as Ghostscript) offers both free and proprietary versions.

Most of the topics in this book are applicable to any platform (Windows, *nix, Mac OS). You may, however, detect a slight bias toward the Unix world, since most of the book’s development was done on a Linux-based system, and some of the tools (such as the Gimp) started their lives in the Unix world (just like Perl).

The book is divided into three sections that correspond to three types of images and application areas: raster images and web graphics; vector images and animations; and documents and printing.

Get Perl Graphics Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.