An image processing apparatus includes: a processor configured to execute: acquiring image data; generating a first interpolation image data corresponding to light in a red wavelength band, a second interpolation image data corresponding to light in a green wavelength band, a third interpolation image data corresponding to light in a blue wavelength band, and fourth interpolation image data corresponding to narrow band light; calculating a ratio of a pixel value of the fourth interpolation image data to a pixel value of the second interpolation image data for each region including one or a plurality of pixels; extracting a pixel of the fourth interpolation image data in the region where the calculated ratio exceeds a predetermined threshold value; generating a composite image data based on the pixel value of the extracted pixel and the second or the third interpolation image data; and generating color image data.