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 including an occlusion region; and a synthesizing unit configured to synthesize the plurality of blurred image data pieces.