1. A method for enhancing a document image, the method implemented at least in part by a data processing system and comprising: receiving a digitized image of a document containing text or graphics, the digitized image including an array of pixels having pixel values; decomposing the digitized image into a pedestal image and a residual image, low-spatial-frequency content in the digitized image being primarily represented by the pedestal image and high-spatial-frequency content in the digitized image being primarily represented by the residual image; determining a first gain factor image wherein the pixel values of the first gain factor image are a continuous monotonic function of the corresponding residual image pixel values, the first gain factor image pixel values being substantially equal to a first maximum gain for non-negative residual image pixel values, and the first gain factor image pixel values being substantially equal to a first minimum gain for residual image pixel values that are less than a first residual threshold; determining a second gain factor image wherein the pixel values of the second gain factor image are a continuous monotonic function of the corresponding residual image pixel values, the second gain factor image pixel values being substantially equal to a second minimum gain for non-negative residual image pixel values, and the second gain factor image pixel values being substantially equal to a second maximum value for residual image pixel values less than a second residual threshold; determining a scaled pedestal image by multiplying the pedestal image by the first gain factor image; determining a scaled residual image by multiplying the residual image by the second gain factor image; determining an enhanced document image by combining the scaled pedestal image and the scaled residual image; and storing the enhanced document image in a processor accessible memory.