in reply to image statistics

Is there a Perl module that can handle an image as a complex array of integer values? Is there some better way of using ImageMagick for this?
Assuming the image you're using is supported by imlib2, you're probably better off using Image::Imlib2 and it's query_pixel function.

As far as statistics go, PDL is a common choice, or you could use Statistics::Basic or go even more complex, and send the data to R.