1. An image processing apparatus comprising: a CPU configured to carry out functions of a pixel appending unit, a first generating unit, and a second generating unit: said pixel appending unit configured to generate first image data by executing appending processing for appending pixels required to extend effective image data, which is outputted from effective pixels included in an image sensor, in a scanning direction using pixels at an end portion of the effective image data in the scanning direction; said first generating unit configured to generate second image data obtained by reducing the first image data by applying filtering to the first image data; and said second generating unit configured to generate third image data obtained by reducing the second image data by applying filtering to the second image data, wherein the second image data includes a second effective pixel whose centroid matches that of a first effective pixel at a terminal end of the effective image data in the scanning direction, and the third image data includes a third effective pixel whose centroid matches that of the second effective pixel.