A method of processing a digital gray or color image in order to enhance the reproduction of black or gray marks of said image, comprising the following steps: - classifying the input pixels into four different color classes, denoted as white (w), light (l), color (c) and dark (d), by determining for each pixel, among the Hue Saturation Intensity color coordinate system, its saturation and its intensity values and by comparing the resulting saturation and intensity values (S & I) to four pre-determined color thresholds, - using said color class (w, l, c, d) of each individual pixel, along with the color classes of pixels of a small neighboring region, to further classify each individual pixel into a pixel type among four pixel types denoted as background type, text type, gray type and image type, by applying the following rules: -- if the color class of the individual pixel is white, classifying said individual pixel as background type, -- for non-white pixel color classes, separately summing the numbers of all light (l), colored (c) and dark (d) classified pixels in the neighborhood of the individual pixel in a summing filter, thus producing three sum numbers ( d̂, ĉ and l̂) and using these sum numbers as three indices into a look-up table (Text LUT) to classify the individual pixel type as text candidates, and applying an additional filter such that only pixels that are text candidates and which have nearby background pixels are classified as text type, - using said pixel type to determine which color correction process to apply to the corresponding pixel. - classifying the input pixels into four different color classes, denoted as white (w), light (l), color (c) and dark (d), by determining for each pixel, among the Hue Saturation Intensity color coordinate system, its saturation and its intensity values and by comparing the resulting saturation and intensity values (S & I) to four pre-determined color thresholds, - using said color class (w, l, c, d) of each individual pixel, along with the color classes of pixels of a small neighboring region, to further classify each individual pixel into a pixel type among four pixel types denoted as background type, text type, gray type and image type, by applying the following rules: -- if the color class of the individual pixel is white, classifying said individual pixel as background type, -- for non-white pixel color classes, separately summing the numbers of all light (l), colored (c) and dark (d) classified pixels in the neighborhood of the individual pixel in a summing filter, thus producing three sum numbers ( d̂, ĉ and l̂) and using these sum numbers as three indices into a look-up table (Text LUT) to classify the individual pixel type as text candidates, and applying an additional filter such that only pixels that are text candidates and which have nearby background pixels are classified as text type, -- if the color class of the individual pixel is white, classifying said individual pixel as background type, -- for non-white pixel color classes, separately summing the numbers of all light (l), colored (c) and dark (d) classified pixels in the neighborhood of the individual pixel in a summing filter, thus producing three sum numbers ( d̂, ĉ and l̂) and using these sum numbers as three indices into a look-up table (Text LUT) to classify the individual pixel type as text candidates, and applying an additional filter such that only pixels that are text candidates and which have nearby background pixels are classified as text type, - using said pixel type to determine which color correction process to apply to the corresponding pixel.