Getting RGB and luminosity data

I am making composite photographs from many photographs. I’d like to automate the process of listing photo’s basic information – mean luminosity and RGB values. Ideally, I’d like to give some software a set of images, extract that data from the files, and create a spreadsheet with image name, luminosity, and RGB average numbers.

These numbers are available in Photoshop, but I don’t know how to automatically get them. Bridge, Adobe’s catalog program, does not have that data in its collection of metadata.

Any ideas you’ve got would be appreciated.