Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Programming > Perl Modules

    Imager::ImageTypes 0.61

    Download button

    No screenshots available
    Downloads: 326  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Tony Cook, Arnar M. Hrafnkelsson | More programs
    Perl Artistic License / FREE
    November 11th, 2007, 02:05 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Imager::ImageTypes description

    Imager::ImageTypes is a Perl module that contains image models for Imager.

    Imager::ImageTypes is a Perl module that contains image models for Imager.

    SYNOPSIS

    use Imager;

    $img = Imager->new(); # Empty image (size is 0 by 0)
    $img->open(file=>'lena.png',type=>'png'); # Read image from file

    $img = Imager->new(xsize=>400, ysize=>300); # RGB data

    $img = Imager->new(xsize=>400, ysize=>300, # Grayscale
    channels=>1); #

    $img = Imager->new(xsize=>400, ysize=>300, # RGB with alpha
    channels=>4); #

    $img = Imager->new(xsize=>200, ysize=>200,
    type=>'paletted'); # paletted image

    $img = Imager->new(xsize=>200, ysize=>200,
    bits=>16); # 16 bits/channel rgb

    $img = Imager->new(xsize=>200, ysize=>200,
    bits=>'double'); # 'double' floating point
    # per channel

    $img->img_set(xsize=>500, ysize=>500, # reset the image object
    channels=>4);


    # Example getting information about an Imager object

    print "Image information:n";
    print "Width: ", $img->getwidth(), "n";
    print "Height: ", $img->getheight(), "n";
    print "Channels: ", $img->getchannels(), "n";
    print "Bits/Channel: ", $img->bits(), "n";
    print "Virtual: ", $img->virtual() ? "Yes" : "No", "n";
    my $colorcount = $img->getcolorcount(maxcolors=>512);
    print "Actual number of colors in image: ";
    print defined($colorcount) ? $colorcount : ">512", "n";
    print "Type: ", $img->type(), "n";

    if ($img->type() eq 'direct') {
    print "Modifiable Channels: ";
    print join " ", map {
    ($img->getmask() & 1colorcount;
    @colors = $img->getcolors();
    print "Palette size: $countn";
    my $mx = @colors > 4 ? 4 : 0+@colors;
    print "First $mx entries:n";
    for (@colors[0..$mx-1]) {
    my @res = $_->rgba();
    print "(", join(", ", @res[0..$img->getchannels()-1]), ")n";
    }
    }

    my @tags = $img->tags();
    if (@tags) {
    print "Tags:n";
    for(@tags) {
    print shift @$_, ": ", join " ", @$_, "n";
    }
    } else {
    print "No tags in imagen";
    }

    Requirements:

    · Perl



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    image models | Imager models | Perl module | Imager | image | models

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM