1. An image forming apparatus to form a color image by superimposing images of a plurality of colors one above the other, the apparatus comprising: an image forming device to form a plurality of patterns on a surface of an image carrier using the plurality of colors as a first pattern, and to form a plurality of patterns on the surface of the image carrier using one of the plurality of colors as a second pattern, the plurality of patterns of the second pattern each configured to be formed at a pitch substantially the same with a pitch of corresponding one of the plurality of patterns of the first pattern; a detector to obtain a first detection result indicating the pitch of each one of the plurality of patterns of the first pattern, and to obtain a second detection result indicating the pitch of each one of the plurality of patterns of the second pattern; and a controller to calculate a difference between the first detection result and the second detection result to obtain a difference value, to calculate a correction value using the second detection result and the difference value, and to control the image forming device according to the correction value to suppress color shifts in the images.