1. An image processing apparatus which performs blurring processing on captured image data based on distance information of a subject, the apparatus comprising: a dividing unit configured to divide the captured image data into a plurality of image data pieces corresponding to pieces of the distance information different from each other; a generating unit configured to generate a plurality of blurred image data pieces by performing blurring processing on the plurality of divided image data pieces; and a synthesizing unit configured to synthesize the plurality of blurred image data pieces, wherein the plurality of divided image data pieces includes a first divided image data piece corresponding to a first distance information piece and a second divided image data piece corresponding to a second distance information piece that indicates a more rear side than the first distance information piece, wherein the generating unit generates a first blurred image data piece by performing the blurring processing on the first divided image data piece and generates a second blurred image data piece by performing the blurring processing on the second divided image data piece and an occlusion region, and wherein the synthesizing unit adds pixel values of the occlusion region after the blurring process to pixel values of a region of the first blurred image data piece corresponding to the occlusion region, and a different proportion is used for the adding of the synthesizing unit in at least a partial region within the occlusion region.