1. An image forming apparatus for forming an image on a recording medium comprising: a first image-forming material that contains a colored pigment and a second image-forming material that contains the colored pigment having a concentration lower than that of the first image-forming material; a first image forming unit that forms a code image representing encoded information on the recording medium using the second image-forming material; a second image forming unit that forms a first non-code image at a position other than the position of the code image on the recording medium using an image-forming material other than the second image-forming material; and a third image-forming material in which the optical absorptance corresponding to that of the colored pigment is not greater than that of the second image-forming material; a determination section that determines an area in which the code image and a second non-code image overlap; and a third image forming unit that forms the second non-code image in only the area determined by the determination section on the recording medium using the third image-forming material.