According to one aspect of the present invention, there is provided an image forming apparatus which performs print processing of image data, comprising: an expansion unit which performs downsampling processing for input image data, and then restores a target pixel of the image data, for which image processing has been performed, to the number of pixels at the time of input; a conversion unit which converts each pixel corresponding to the target pixel, restored to the number of pixels at the time of input by the expansion unit, into a pixel for printing; and a sort unit which reads each pixel corresponding to the target pixel converted by the conversion unit, reads the pixels in a raster order, and sorts the pixels.