1. An image data processing apparatus comprising: a dividing unit that divides image data into a plurality of blocks; a block extracting unit that extracts a pair of blocks from the divided blocks; an index extracting unit that extracts two feature indices of a first color component and two feature indices of a second color component which differs from the first color component from the pair of blocks, one of the two feature indices being extracted from one of the pair of blocks and the other of the two feature indices being extracted from the other of the pair of blocks; and a code embedding unit that embeds a code into the pair of blocks, by changing at least one of the extracted two feature indices of the first color component of the pair of blocks based on a magnitude relationship between the extracted two feature indices of the second color component of the pair of blocks and a value determined by at least one of the extracted two feature indices of the second color component.