in reply to Extracting pixel values
sub get_pixel($$) { my ( $x, $y) = @_; substr ( $image, $y * $height + $x, 1); }
I know this is over-simplification, but I use these direct memory hacks once in a while, f.ex. $image = ~$image for images of cardinal pixels is as valid and fast as any other image negation. Your pixel extraction problem might just as well hit the same area.
Otherwise, of course, a number of libraries provide generic image access, as mentioned above.
|
|---|