1. An image processing apparatus comprising: a determination unit configured to determine, based on a threshold and values of a plurality of pixels in a reference area that includes a target pixel of first image data, whether or not the target pixel is included in an edge portion; a halftone processing unit configured to generate second image data by performing halftone processing on the first image data; and a correction unit configured to use correction data generated based on a value of the target pixel to correct a pixel value of the second image data corresponding to the target pixel determined to be included in the edge portion by the determination unit, wherein the threshold is determined by using values determined based on values of the plurality of pixels in the reference area.