1. An image processing apparatus configured to generate code information represented by a dot array and attach the code information on an image, the image processing apparatus comprising: a determination unit configured to determine a location to attach code information based on mutually-different patterns of locations to attach the code information; and an attaching unit configured to attach the code information on the image at a location corresponding to the location determined by the determination unit.