1. An image processing apparatus comprising: an acquisition unit that acquires data of a plurality of images with different focal points; a first map generation unit that generates a depth map that represents a distance relationship of a subject, for each of a plurality of images acquired by the acquisition unit, in an image for each of a predetermined number of pixels; a second map generation unit that generates a new depth map by performing predetermined processing on a plurality of depth maps generated by the first map generation unit; and an image composition unit that composites data of the plurality of images for each pixel according to a ratio of composition for each pixel designated by the new depth map generated by the second map generation unit, and generates data of an omnifocal image.