Modify the compiz plugin "opacity, brightness and saturation" by adding the auto-bright fonctionnality and giving choice between two modes: screen mode and window mode. The window mode would adjust brightness of each window according to its own colors, while screen mode would adjust the entire screen brightness (or backlight) to its colors too.
Create an independant package doing the same stuff, so that everybody can use it, either he uses compiz, metacity, or other. For example, take the case of the netbook that i am using now: compiz slow it down significantly so i don't use compiz on this computer, and i am constantly changing manually the brightness setting because of my particular sensitivity of the eyes.
See the french thread on this subject that i recently launched:
Contributions are needed.