1. In a method of processing a digital image by computer, including the steps of forming a gray-level histogram of the digital image, forming a peak detection function from the gray-level histogram, employing the peak detection function to detect peaks in the histogram, and employing the location of detected peaks to process the image, the improvement wherein said step of forming a peak detection function comprises the steps of: a. forming a cumulative distribution function from said gray-level histogram; b. smoothing said cumulative distribution function with a sliding window average of size w to produce a smoothed cumulative distribution function; and c. subtracting said smoothed cumulative distribution function from said cumulative distribution function to produce said peak detection function; and wherein said step of employing the peak detection function to locate peaks in the histogram includes the steps of: a. identifying positive to negative zero crossings of the peak detection function as the start of a detected histogram peak, and b. identifying a maximum following such a positive to negative zero crossing as the end of a detected histogram peak.