1. An image processing device, comprising: a processor; and a processor-readable storage medium, wherein the processor-readable storage medium contains one or more programming instructions for performing a method for processing an input image to form an output image, wherein the input image includes a plurality of input pixels, wherein each input pixel includes an input pixel intensity value having a first number of possible levels, wherein the output image includes a plurality of output pixels, wherein each output pixel includes an output pixel intensity value having a second number of possible levels, the method comprising: determining an input pixel intensity value for an input pixel, determining a modified input pixel intensity value based on information generated when processing one or more previously processed pixels; determining a threshold value based on at least the input pixel intensity value and a stored pixel value corresponding to the input pixel, determining an output pixel intensity value by comparing the modified input pixel intensity value with the threshold value, and modifying one or more stored pixel values based on at least the output pixel intensity level for the output pixel.