1. An image data processing apparatus comprising: a dividing unit that divides image data into a plurality of blocks; an extracting unit that extracts a feature index of a first color component and a feature index of a second color component in each of the blocks; a registration unit that registers information about a correspondence between the feature index of the second color component and a change in the feature index for the first color component; and a code embedding unit that embeds a predetermined code into the image data, by changing the feature index of the first color component based on the feature index of the second color component, using the information registered.