Perl Graphics Programming: Creating SVG, SWF (Flash), JPEG and PNG files with Perl

Perl Graphics Programming: Creating SVG, SWF (Flash), JPEG and PNG files with Perl

Language: English

Pages: 480

ISBN: 059600219X

Format: PDF / Kindle (mobi) / ePub


Graphics programmers aren't the only ones who need to be proficient with graphics. Web and applications programmers know that a dull web page can be quickly transformed into one that's interesting and lively with the use of well-planned graphics. And fortunately, you don't need the skills of a fulltime graphics programmer to use graphics effectively. From access counters and log report graphs to scientific plots and on-the-fly animated GIFs, graphics scripting is within the grasp of most web programmers. Using open source software, like Perl, you have the power to dynamically generate graphics based on user input and activity, easily manipulate graphics content, and optimize graphics for compression and quality.Geared toward Perl users and webmasters, Perl Graphics Programming focuses on open-source scripting programs that manipulate graphics files for use on the Web. The book demystifies the manipulation of graphics formats for newcomers to the Web with a practical, resource-like approach. With this book you'll learn to:

  • Generate dynamic web graphics with charts, tables, and buttons
  • Automate graphics tasks (thumbnails and borders)
  • Create dynamics web documents (PDF, Postscript)
  • Produce rich Internet experiences with Flash and SVG

You'll begin with a tour of the most common web graphic file formats--PNG, JPEG, GIF, SWF, SVG, Postscript and PDF--then you'll explore the most powerful tools and Perl modules available for manipulating these graphics, such as GD, PerlMagick, and GIMP. Included in this part of the book is a thorough description of the Ming module for creating on-the-fly Flash files. Next, a "cookbook" section includes practical, all purpose recipes: GIF animation, generating images within a dynamic application, communicating between SWF front-end and Perl back-end, XSLT transformations, compression, and much more.Perl programmers naturally turn to Perl to tackle whatever challenge they have at hand, and graphics programming is no exception. Perl Graphics Programming provides all the tools you need to begin programming and designing graphics for the Web immediately. This book will change how you think about generating and manipulating graphics for the Web.

The Smashing Book #2 (Digital Edition) (Smashing Books)

Responsive Typography: Using Type Well on the Web

HTML5 & CSS3 For The Real World

The Art and Science of CSS

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

color table. $DodgerBlue = $image->colorExact(30,144,255); print "DodgerBlue is in the color table.\n" if $DodgerBlue >= 0; colorResolve( ) $index = $image->colorResolve(red, green, blue) This method combines the colorExact( ) and colorAllocate( ) method calls. It returns the index of the specified color if it is already in the table; if it is not (and there is room), the color is allocated and its index is returned. It returns -1 if the color could not be allocated. This method always succeeds

characters) in the same way that ImageMagick does. Multiple lines of text must be drawn as separate strings, with the space between lines computed using the height( ) object method. You may want to consider using ImageMagick for creating text-intensive graphics, as its font support is more robust than GD’s. An example: $image->string(gdTinyFont,10, 10, "A way a lone a last a loved a long the", $red); stringUp( ) $image->stringUp(font, x, y, string, color) The stringUp( ) method draws a string

nonlinear. Good color matching schemes require various corrections that are determined by experimentation. Unfortunately, a lot of the study and work on the subject is not in the public domain; most of the information is patented by companies that create “color systems” like Pantone or TRUMATCH. That’s the primary reason why a lot 6 | Chapter 1: Creating Graphics with Perl This is the Title of the Book, eMatter Edition Copyright © 2013 O’Reilly & Associates, Inc. All rights reserved. of

$image->Quantize(colorspace => 'RGB', colors => 16, dither => 1 ); 8 | Chapter 1: Creating Graphics with Perl This is the Title of the Book, eMatter Edition Copyright © 2013 O’Reilly & Associates, Inc. All rights reserved. Example 1-1. Converting a truecolor image to 16 colors, with and without dithering (continued) $image->Write('gif:4bitimage.gif'); $image2->Quantize(colorspace => 'RGB', colors => 16, dither => 0 ); $image2->Write('gif:4bitimagenodither.gif'); undef $image; undef $image2;

that they are decoded from the stream, the image is drawn as a grid of pixels that is progressively filled in with more information. Images with this sort of pixel ordering are said to be interlaced. Interlacing is implemented differently by different file formats. Interlaced files tend to be slightly larger than non-interlaced files (except for progressive JPEGs, which tend to be slightly smaller). This is because most compression schemes make certain assumptions about the relationships of

Download sample

Download