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.
.
AND
.
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:
http://forum.ubuntu-fr.org/viewtopic.php?pid=3851918
Contributions are needed.