Linux SoftwareProgrammingLibrariesImager::Tutorial 0.54

Imager::Tutorial 0.54



Developer:   Tony Cook
      more software by author →
Price:  0.00
License:   Perl Artistic License
File size:   836K
Language:   
OS:   
Rating:   0 /5 (0 votes)
Your vote:  
enlarge screenshot


Imager::Tutorial is an introduction to Imager.

Before you start

If you have the necessary knowledge, install the image format libraries you want Imager image file support for, and Imager itself, otherwise arrange to have it done.
You will also want some sort of image viewer tool, whether an image editor like Photoshop or the GIMP, or a web browser.

Hello Boxes! - A Simple Start

As with any perl program it's useful to start with a #! line, and to enable strict mode:

#!/usr/bin/perl -w
# you might to 'use warnings;' instead of the -w above
use strict;

These lines will be omitted in further examples.

As with any module, you need to load it:

use Imager;

Now create a image to draw on:

my $image = Imager->new(xsize => 100, ysize => 100);

and draw a couple of filled rectangles on it:

$image->box(xmin => 0, ymin => 0, xmax => 99, ymax => 99,
filled => 1, color => 'blue');
$image->box(xmin => 20, ymin => 20, xmax => 79, ymax => 79,
filled => 1, color => 'green');

Since the first box fills the whole image, it can be simplified to:

$image->box(filled => 1, color => 'blue');

and save it to a file:

$image->write(file=>'tutorial1.ppm')
or die 'Cannot save tutorial1.ppm: ', $image->errstr;

So our completed program is:

use Imager;

my $image = Imager->new(xsize => 100, ysize => 100);

$image->box(filled => 1, color => 'blue');
$image->box(xmin => 20, ymin => 20, xmax => 79, ymax => 79,
filled => 1, color => 'green');

$image->write(file=>'tutorial1.ppm')
or die 'Cannot save tutorial1.ppm: ', $image->errstr;

Requirements:
  • Perl
    tags image box  tutorial1 ppm  box xmin  color blue  write file  image write  image errstr  file tutorial1  save tutorial1  cannot save  die cannot  box filled  ppm image  

    Download Imager::Tutorial 0.54


     http://mirrors.evolva.ro/CPAN/authors/id/T/TO/TONYC/Imager-0.54.tar.gz


    Authors software

    Imager 0.54 (by Tony Cook)
    Imager script is a Perl extension for generating 24-bit images.

    Requirements:
    · Perl

    What's New in This Release:
    · a new qtyp

    Imager::Fountain 0.54 (by Tony Cook)
    Imager::Fountain is a class for building fountain fills suitable for use by the fountain filter.

    SYNOPSIS

    use Imager::Fountain;

    POE::XS::Queue::Array 0.003 (by Tony Cook)
    POE::XS::Queue::Array is an XS implementation of POE::Queue::Array.

    This class is an implementation of the abstract POE::Queue int

    Imager::Tutorial 0.54 (by Tony Cook)


    Similar software

    Imager::Tutorial 0.54 (by Tony Cook)

    Imager::Fountain 0.54 (by Tony Cook)
    Imager::Fountain is a class for building fountain fills suitable for use by the fountain filter.

    SYNOPSIS

    use Imager::Fountain;

    Imager::interface.pod 0.54 (by Anthony Cook)

    Imager::Color 0.54 (by Arnar M. Hrafnkelsson)
    Imager::Color is a Perl module with color handling for Imager.

    SYNOPSIS

    $color = Imager::Color->new($red, $green, $blue);

    Imager 0.54 (by Tony Cook)
    Imager script is a Perl extension for generating 24-bit images.

    Requirements:
    · Perl

    What's New in This Release:
    · a new qtyp

    Imager::Engines 0.54 (by Arnar M. Hrafnkelsson and Anthony Cook)
    Imager::Engines is a Perl module for programmable transformation operations.

    SYNOPSIS

    use Imager;

    my %opts;
    my @imgs;

    GD::XYScale 1.2 (by Burak Gursoy)
    GD::XYScale can draw a 2D X-Y scale and use it.

    SYNOPSIS

    use GD;
    use GD::XYScale;

    $image = GD::Image->new($width,$

    Imager::Filters 0.54 (by Arnar M. Hrafnkelsson and Tony Cook)

    SGI RGB Image File Plug-In 1.1.1 (by Michael Sweet)
    SGI plug-in provides SGI image file load & save modules for The GIMP

    XV 3.10a (by John Bradley)
    xv is an interactive image manipulation program for the X Window System


    Other software in this category

    zlib 1.2.3 (by Jean-loup Gailly)
    zlib is designed to be a free, general-purpose, legally unencumbered, lossless data-compression library for use on virtually any comp

    libjpeg v6b (by Independent JPEG Group)
    libjpeg is a library for handling the JPEG (JFIF) image format

    OpenSSL 0.9.7c (by The OpenSSL Project Team)
    The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implement

    libxml2 2.6.27 (by DV)
    Libxml2 is the XML C parser and toolkit developed for the Gnome project (but usable outside of the Gnome platform), libxml2 library i

    GNU C library 2.4 (by Andreas Jaeger)
    GNU C library (glibc) is one of the most important components of GNU Hurd and most modern Linux distributions.

    GNU C library is us

  •     search


    Featured Software

    jEdit 4.3 pre8
    jEdit is an Open Source text editor written in Java

    Opera 9.02
    Surf the Internet in a safer, faster, and easier way with Opera browser

    GNU Aspell 0.60.4
    GNU Aspell is a Free and Open Source spell checker designed to eventually replace Ispell


    Subscribe in Rojo
    Google Reader
    Add to My Yahoo!

    Add to My AOL
    Subscribe with Bloglines
    Subscribe in NewsGator Online
    Add 'nixbit linux software' to Newsburst from CNET News.com
    del.icio.us nixbit linux software


    Top tags