1. A method for generating a halftone image having output pixels from an input image comprising input pixels having input pixels values, said method comprising the steps of: for each input pixel, adding an error term to the input pixel value to obtain a modified input pixel value, wherein the error term is a weighted sum of error values of previous pixels to be directed to the input pixel; determining an error diffusion threshold level based on the input pixel value; applying a quantization operation to the modified input pixel value using the determined error diffusion threshold level for obtaining an output pixel value; and determining an error value of the input pixel that is a difference between the output pixel value and the modified input pixel value, wherein the error diffusion threshold level depends on a result of a comparison operation performed between the input pixel value and a threshold value selected from a set of threshold values, the selection of the threshold value being based on the position of the input pixel in the input image.