1. An image processing apparatus comprising: a processor; and a memory coupled to the processor, the memory having instructions stored thereon which, when executed by the processor, cause the image processing apparatus to: perform screen processing on input image data; detect a boundary pixel by determining whether or not a pixel of interest is a boundary pixel in the input image data, wherein the pixel of interest is detected as a boundary pixel when the pixel of interest is not a white pixel and adjacent to a white pixel; selectively output image data based on a result of the detection, wherein, in a case where the pixel of interest is determined as the boundary pixel, a value of the pixel of interest of the input image data on which the screen processing has not been performed is outputted as an output value of the pixel of interest, and wherein, in a case where the pixel of interest is determined not to be the boundary pixel, a value of the pixel of interest of the image data obtained by performing the screen processing is outputted as an output value of the pixel of interest; calculate a sum value of the input image data as a first sum value for each cell in the screen processing; calculate, as a second sum value for each cell in the screen processing, a sum value of image data output; calculate a correction value based on a difference between the first sum value and the second sum value, and a number of effective pixels in the cell; and correct the output image data based on the correction value.