The image forming apparatus forms an image on a prescribed recording medium by carrying out digital halftoning using a threshold value matrix. The image forming apparatus comprises: a plurality of nozzles which eject ink toward the recording medium to form an image; an ejection characteristics determination device which determines ejection characteristics of each of the nozzles; and a threshold value correction device which performs first threshold value correction to reduce density non-uniformity occurring in the image due to error in the ejection characteristics of the nozzles, by correcting the threshold value matrix according to the error in the ejection characteristics of the nozzles, and performs second threshold value correction to reduce granularity in the image by correcting the threshold value matrix having undergone the first threshold value correction, according to threshold values in the threshold value matrix.