Patent ID: 8878874

Claim:
An image overlaying device comprising: an image inputting unit configured to input image data of documents; a memory; a controller configured to: obtain template data, which define a plurality of layout areas, for laying out the inputted image data of each of the documents; extract each of the plurality of layout areas from the obtained template data; determine positions of the extracted plurality of layout areas; store, in the memory, in association with each of the plurality of layout areas, layout order information corresponding to an order of the plurality of layout areas before the image inputting unit inputs the image data of each of the documents; store, in the memory, in association with each of the image data, image order information corresponding to an order of the image data of the documents; determine corresponding image data of documents corresponding to each of the plurality of layout areas based on the layout order information and the image order information; store, in the memory, a plurality of shapes for an overlap area corresponding to a layout area where a plurality of document image data are laid out to partly overlap each other, each of the plurality of shapes represents a contour of the overlap area in which the plurality of document image data are to be laid out to partly overlap each other; determine whether or not each of the extracted plurality of layout areas is the overlap area by determining whether or not each of the extracted plurality of layout areas has a shape which accords with one of the shapes of the overlap area stored in the memory; and generate overlaid image data by laying out, in each of the plurality of layout areas, the determined corresponding image data of the documents, wherein the controller is configured to store, in the memory, with respect to each of the plurality of shapes of the overlap area, the number of document image data to be laid out in the overlap area in association with overlap order information corresponding to layout positions and layout orders of image data to be laid out in the overlap area, and wherein the controller is configured to, when the controller determines that the layout area is the overlap area, store, in the memory, based on the overlap order information, layout order information respectively for each of the image data stored in the memory in association with the layout positions of the image data in the overlap area.