An image forming apparatus for overlaying toner images of at least two
colors on an image carrier, and forming the toner images on a printing
medium, counts the perimeter of the image carrier on the basis of a
reference signal and a sampling period of a clock count, and sets target
values of image formation start timings for respective colors in
consideration of a perimeter error of the image carrier due to a
quantization error produced upon counting on the basis of the reference
signal and the sampling period of the clock count.