1. An image processing apparatus comprising: a hardware processor configured to: separate an input frame image data item into a moving subject layer and a background layer; and generate a combined image data item by performing an image combining process using the input frame image data item, wherein: in the image combining process, in a predetermined area in which the input frame image data item overlaps with a frame image data item of a previously performed combining process on a different portion of the combined image data item, a layer-image combining process is performed in which a top priority is given to the moving subject layer of the input frame image data item, a second priority is given to a moving subject layer of the frame image data item associated with the previously performed combining process, a third priority is given to the background layer of the input frame image data item, and a fourth priority is given to a background layer of the frame image data item associated with the previously performed combining process; the predetermined area has an area that is smaller than an area of any of the background layers; and a portion in the background layer of the input frame image data item is shifted with respect to a corresponding portion in the background layer of the frame image data item associated with the previously performed combining process, in the combined image data item.