#!/usr/bin/perl use strict; use warnings; use Imager; my $image_source = shift @ARGV; my $image = Imager->new; $image->read( file => $image_source ) or die "Cannot load $image: ", $image->errstr; my $width = $image->getwidth(); my $height = $image->getheight(); print "Image dimensions: height = $height, width = $width\n"; my $x = 10; foreach my $y ( 10 .. 15 ) { my $color = $image->getpixel( x => $x, y => $y ); my ( $r, $g, $b, $a ) = $color->rgba(); print " shade = $r, $g, $b\n"; }