Perl Graphics Programming Examples


Download everything as a TAR archive (1.08MB).




Chapter 2

Requirements

Example 2-1. Hello world on a field of polka dots
Example 2-2. Generating a customized billboard image from user input.
Example 2-3. The BrokenImage module.
Example 2-4. Using LWP to grab image data off the web and hand it off to GD
Example 2-5. Drawing paths with polygons. This script draws a hobo symbol meaning "man with gun."
Example 2-6. Calling map() repeatedly on a triangle


Chapter 3

Requirements

Example 3-1. Hello World in ImageMagick
Example 3-2. Creating thumbnails with Montage()
Example 3-3. PDFconvert.pl creates thumbnails of the first page of any number of PDF files provided on the command line, and also writes out a simple HTML index file.
Example 3-4. Scroll an image through a frame from right to left.


Chapter 4

Requirements

Example 4-1. Cheese graph
Example 4-2. Stock grapher
Example 4-3. Seven Deadly Sins
Example 4-4. Generate the html for biorhythm graphing example.
Example 4-5. Dynamically generate a biorhythm bar graph from data passed in from a form.


Chapter 5

Requirements

Example 5-1. Text Grid
Example 5-2. Apply Tint
Example 5-3. Colorize.
Example 5-4. Adjust Alpha
Example 5-5. A standalone script


Chapter 6

Requirements

Example 6-1. A simple SVG
Example 6-2. An alternative way of drawing the same simple SVG
Example 6-3. Using the tag
Example 6-4. Using polygons and polylines
Example 6-5. Text in an image
Example 6-6. Text on a path
Example 6-7. Links within an image


Chapter 7

Requirements

Example 7-1. Sample slideshow file
Example 7-2. A slide show presentation tool
Example 7-3. Create an animated bouncing ball as a SVG file.
Example 7-4. An example using JavaScript to create an SVG animation.
Example 7-5. Using Unicode characters in SVG.
Example 7-6. A slighly different XML slide presentation format
Example 7-7. An XSLT transform
Example 7-8. A simple wrapper that passes an XML file and template (XSLT) file to the Sablotron processor and prints the result.


Chapter 8

Example 8-1. SWFAnalyze.pl


Chapter 9

Requirements


Example 9-1. Astral Trespassers.
Example 9-2. An animation using SWF::DisplayItem to position each element of each frame.
Example 9-3. A program for drawing a logarithmic spiral shape..
Example 9-4. Reading in a bitmap image.
Example 9-5. Morphing between two shapes.
Example 9-6. Draw a circle using an arbitrary number of cubic Bezier segments. Useful for a) drawing a circle that looks circular; b) creating circles for use in Morphs.
Example 9-7. Create an SWF file with a "preloader"
Example 9-8. Using loadMovie().
Example 9-9. A chat server that communicates with an SWF client.
Example 9-10. Create an SWF chat client.


Chapter 10

Requirements

  • A PostScript viewer such as GhostView Example 10-1. Draw two pages with text
    Example 10-2. A spiral
    Example 10-3. A properly formatted PostScript document
    Example 10-4. Another spiral
    Example 10-5. Using Text::PDF to create a simple PDF document


    Chapter 11

    Requirements

    Example 11-1. The HTML document for the CGI example
    Example 11-2. Draw a PostScript invoice with TextBlocks and Elements
    Example 11-3. Using the textBlock module
    Example 11-4. Using the Document object
    Example 11-5. Using the Elements module


    Chapter 12

    Requirements

    Example 12-1. Hello World with the Text object
    Example 12-2. Hello World with graphics
    Example 12-3. Inserting a JPEG image and clipping it.
    Example 12-4. Address labels with PDF::API2.
    Example 12-5. Modifying an existing PDF file.
    Example 12-6. Adding an outline to a PDF document.