A set pattern image with no displacement is recorded onto recording paper. In this set pattern image, the centers of auxiliary patterns are displaced in an auxiliary scan direction off a referential straight line passing through the centers of primary patterns. The image forming apparatus causes the set pattern image to be read, measures the displacements of the auxiliary patterns in the auxiliary scan direction off the referential straight line, and compensates for the displacements, such as by adjusting writing timings in the auxiliary scan direction so that the displacements become zero.