1. An image forming apparatus 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 a recording medium using the second image-forming material; and a second image forming unit that forms a 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.