1. An image processing apparatus comprising: a subject detection unit that detects at least one subject in a captured image; a subject position analysis unit that judges arrangement of the at least one subject in the captured image by an arithmetic operation; an image selection unit that selects at least one composition-purpose image in accordance with the arrangement of the at least one subject; an image arrangement unit that determines arrangement of the selected at least one composition-purpose image so that the at least one composition-purpose image does not overlap with one another and does not overlap with the detected at least one subject; and an image composition unit that generates a composite image by combining the captured image with the at least one composition-purpose image, wherein when the number of detected subject is two or more, the image arrangement unit selects the at least one composition-purpose image based on an arrangement relation between the detected subjects.