1. A method of enhancing a digital image comprising: receiving a digital image; determining a lighting impairment type of the digital image; processing the received digital image based on the determined lighting impairment to produce a pre-processed image that appears as a particular impairment type of an enhancement algorithm; and applying the enhancement algorithm for the particular impairment type to produce a processed image, the enhancement algorithm applied to: the pre-processed image when the lighting impairment type of the digital image does not match the particular impairment type of the enhancement algorithm; or the digital image when the lighting impairment type of the digital image matches the particular impairment type.