An image processing apparatus for processing an electronic image which was obtained by forming an image on a photoelectric conversion element by an optical system which includes a diffractive optical element, the image processing apparatus comprising: a pixel detecting section for detecting a position of a high brightness pixel having a brightness of a predetermined value or more in the electronic image; a deterioration detecting section for detecting a flare image region of the electronic image surrounding the high brightness pixel by employing the high brightness pixel as a reference point, wherein, in the flare image region, the electronic image comprises a generated amount of an image-quality deteriorating component which was generated by a diffracting action of the diffractive optical element; and wherein the deterioration detecting section is adapted to use information regarding image-forming properties of the optical system when detecting the flare image region, the electronic image comprises for each pixel a respective brightness for each of three different colors; characterized in that the image processing apparatus comprises an edge processing section adapted to perform edge processing on the electronic image, whereby, for each of the three colors, the respective brightness in the flare image region around the high brightness pixel is emphasized relative to a background image of the electronic image and the background image is weakened; wherein the deterioration detecting section is adapted to detect the flare image region based on the respective brightnesses obtained by the edge processing; and wherein the image processing apparatus further comprises a correcting section for removing or reducing the image-quality deteriorating component on the basis of the generated amount if the flare image region is detected by the deterioration detecting section. a pixel detecting section for detecting a position of a high brightness pixel having a brightness of a predetermined value or more in the electronic image; a deterioration detecting section for detecting a flare image region of the electronic image surrounding the high brightness pixel by employing the high brightness pixel as a reference point, wherein, in the flare image region, the electronic image comprises a generated amount of an image-quality deteriorating component which was generated by a diffracting action of the diffractive optical element; and wherein the deterioration detecting section is adapted to use information regarding image-forming properties of the optical system when detecting the flare image region, the electronic image comprises for each pixel a respective brightness for each of three different colors; characterized in that the image processing apparatus comprises an edge processing section adapted to perform edge processing on the electronic image, whereby, for each of the three colors, the respective brightness in the flare image region around the high brightness pixel is emphasized relative to a background image of the electronic image and the background image is weakened; wherein the deterioration detecting section is adapted to detect the flare image region based on the respective brightnesses obtained by the edge processing; and wherein the image processing apparatus further comprises a correcting section for removing or reducing the image-quality deteriorating component on the basis of the generated amount if the flare image region is detected by the deterioration detecting section.