Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    Image::Imlib2 2.00

    Download button

    No screenshots available
    Downloads: 444  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Good (3.8/5)
    5 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Leon Brocard | More programs
    Perl Artistic License / FREE
    December 7th, 2007, 23:11 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Image::Imlib2 description

    Image::Imlib2 is a Perl interface to the Imlib2 image library.

    Image::Imlib2 is a Perl interface to the Imlib2 image library.

    SYNOPSIS

    use Image::Imlib2;

    # create a new image
    my $image = Image::Imlib2->new(200, 200);

    # or load an image
    $image = Image::Imlib2->load("foo.png");

    # Enable the alpha channel support
    $image->has_alpha(1);

    # set a colour (rgba, so this is transparent orange)
    $image->set_color(255, 127, 0, 127);

    # draw a rectangle
    $image->draw_rectangle(50, 50, 50, 50);

    # draw a filled rectangle
    $image->fill_rectangle(150, 50, 50, 50);

    # draw a line
    $image->draw_line(0, 0, 200, 50);

    # set quality before saving
    $image->set_quality(50);

    # save out
    $image->save('out.png');

    # create a polygon
    my $poly = Image::Imlib2::Polygon->new();

    # add some points
    $poly->add_point(0, 0);
    $poly->add_point(100, 0);
    $poly->add_point(100, 100);
    $poly->add_point(0, 100);

    # fill the polygon
    $poly->fill();

    # draw it closed on image
    $image->draw_polygon($poly, 1);

    # create a color range
    my $cr = Image::Imlib2::ColorRange->new();

    # add a color
    my ($distance, $red, $green, $blue, $alpha) = (15, 200, 100, 50, 20);
    $cr->add_color($distance, $red, $green, $blue, $alpha);

    # draw it
    my($x, $y, $width, $height, $angle) = (20, 30, 200, 200, 1);
    $image->fill_color_range_rectangle($cr, $x, $y,
    $width, $height, $angle);

    Image::Imlib2 is a Perl port of Imlib2, a graphics library that does image file loading and saving as well as manipulation, arbitrary polygon support, etc. It does ALL of these operations FAST. It allows you to create colour images using a large number of graphics primitives, and output the images in a range of formats.

    Image::Imlib2::Polygon and Image::Imlib2::ColorRange are described following Image::Imlib2 but may be referenced before their description.

    Note that this is an early version of my attempt at a Perl interface to Imlib2. Currently, the API is just to test things out. Not everything is supported, but a great deal of functionality already exists. If you think the API can be tweaked to be a bit more intuitive, drop me a line!
    Note that a development version of Imlib2 must be installed before installing this module.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    Imlib2 interface | Perl interface | image library | Imlib2 | Perl | interface

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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