A Variational Framework for Retinex