1. A method performed by data processing apparatus, the method comprising: accessing a plurality of pixels that represent a digital image in an RGB color space; processing the accessed plurality of pixels based on a darkness of the digital image to adjust a contrast and a brightness of color space values of the plurality of pixels, resulting in a first plurality of processed pixels; processing the accessed plurality of pixels based on a lightness of the digital image to adjust a contrast and a brightness of the color space values of the plurality of pixels resulting in a second plurality of processed pixels; and combining the first plurality of processed pixels and the second plurality of processed pixels to generate a processed output image.