1. A method comprising: (a) computing an intensity image that identifies the intensity of pixels of an input image; (b) creating a histogram of the intensity image; (c) computing a transformation function, using a first side of the histogram, that can be used to adjust the intensity of a low light portion of the digital image; (d) applying the transformation function to individual color components of the digital image; and (e) applying a contrast enhancement to each transformed color component, wherein the contrast enhancement of a color component is based on computation of a gain map of the color component, said gain map computed using a parameter of the first transformation function.