sub process { my $image = shift @_; my $bmp = Image::BMP->new(); $bmp->open_file($image); print $bmp->xy(3,3); my $width = $bmp->{Width}; my $height = $bmp->{Height}; my $total_pixels = $width * $height; # my $pixels[$width][$height]; my @pixels; #Read it into an array for my $x ($width) { for my $y ($height) { my $hsv = rgb_to_hsv(( $bmp->xy_rgb( $x, $y ))); $pixels[$x]->[$y] = $hsv; } } print Dumper(@pixels); return ( $total_pixels, \@pixels ); }