Code:
#!/usr/bin/perl
use GD;
my $image = GD::Image->new("whatever.jpg");
my ($width, $height) = $image->getBounds();
foreach $x (0..$width) {
foreach $y (0..$height) {
my($red, $green, $blue) = $image->rgb($image->getPixel($x, $y));
print "color is $red $green $blue at $x $y\n";
}
} Hey, that's the easy part.