1. An image processing apparatus for generating halftone image data that is usable by an image forming apparatus which forms an image on a recording medium, the image processing apparatus comprising: a recovery processing unit configured to perform, on input image data, recovery processing for recovering sharpness of a frequency component lower than a predetermined frequency in image sharpness that is deceased by the image forming apparatus; and a halftone processing unit configured to convert the image data subjected to the recovery processing by the recovery processing unit into halftone image data with a number of gradation levels which is able to be output by the image forming apparatus, wherein the halftone processing unit includes: a target value calculation unit configured to calculate, as a target value, a number of dots that are to be output for each local region of the image data subjected to the recovery processing; an acquisition unit configured to acquire threshold values corresponding to the local region; an edge intensity calculation unit configured to calculate edge intensity in the local region; a division unit configured to divide pixels included in the local region into a first pixel group and a second pixel group based on a pixel value of each pixel; a distribution order determination unit configured to calculate, with respect to each pixel included in the local region, an evaluation value of each pixel based on a pixel value of each pixel, a threshold value corresponding to each pixel, and the edge intensity and to determine a distribution order, in which dots are to be distributed, based on an order of the evaluation value; and an output value determination unit configured to determine an output value for each pixel in the local region by distributing dots to pixels included in the local region as much as the target value while referring to the distribution order, and wherein the distribution order determination unit calculates the evaluation value in such a way that dots are likely to be distributed to the first pixel group and dots are unlikely to be distributed to the second pixel group.