1. In a digital medium environment for editing digital images, a method of enhancing digital images by modifying illumination of pixels based on pixel content, comprising: generating, by at least one processor, a cleaning confidence map comprising a plurality of cleaning confidence values corresponding to a plurality of pixels of a digital image by: determining whether a first pixel portrays a glyph in the digital image; comparing a color value of the first pixel and a luminance value of the first pixel to generate a color and illumination confidence value of the first pixel; and generating a first cleaning confidence value of the cleaning confidence map corresponding to the first pixel based on the determination of whether the first pixel portrays a glyph in the digital image and based on the color and illumination confidence value; removing, using the cleaning confidence map, a shadow represented by one or more pixels in the digital image by adjusting a luminosity of each of the one or more pixels representing the shadow based on luminosities of pixels surrounding the one or more pixels and a cleaning confidence value corresponding to the one or more pixels; and modifying, using the cleaning confidence map, a contrast of the digital image by modifying a luminosity the plurality of pixels based on a maximum luminance value of the digital image, a minimum luminance value of the digital image, and the cleaning confidence values of the cleaning confidence map corresponding to the pixels of the plurality of pixels.