scripting in VSE or comp nodes?

Can Python find colour information about a movie clip/images seq.? I would like to find brightest and darkest as well as average brightest on a per frame basis. So that I could re-map image brightness over time.