1. An image processing apparatus for joining first image data and second image data each having one portion overlapping with the other into single image data for output, comprising: means for detecting discrepancies between the first image data in the overlapping portion and the second image data in the overlapping region; means for setting a joining line through the overlapping region to join the first image data and the second image data so that the discrepancies between the first image data and the second image data on the joining line are minimized; and means for combining the first image data and the second image data according to the joining line.