1. A method of processing an image, comprising: accessing, by a processing device, an image file containing data representing an image of at least a portion of a printed document; selecting a neighborhood of adjacent pixels, wherein at least a portion of the pixels in the neighborhood are associated with raster content in the image and each pixel in the neighborhood has an attribute value; determining a weighted average of the attribute values for the pixels in the neighborhood, and modifying the attribute values of at least some of the pixels in the neighborhood in accordance with the weighted average; applying graylevel scaling to the pixels in the neighborhood to determine whether any pixel should be classified as an end range pixel, and for each classified end range pixel whose attribute value does not equal an end range level, modifying the attribute value of that pixel to be scaled to a full data range of the attribute values; applying error diffusion to the pixels in the neighborhood to distribute the neighboring pixels over a range of attribute value levels, wherein the range is from 3 levels to 64 levels; performing a bit level conversion to the pixels in the neighborhood so that each pixel having an attribute value that is below a midpoint is assigned a first attribute value level and each pixel having an attribute value above the midpoint is assigned a second attribute value level to yield a modified image; and saving the modified image as a modified image file.