1. An image processing apparatus which processes 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 which detects a position of a high brightness pixel having a brightness of a predetermined value or more in the electronic image; a deterioration detecting section which detects or estimates a generated amount of an image-quality deteriorating component which was generated by a diffracting action of the diffractive optical element in the electronic image by employing the high brightness pixel as a reference point; and a correcting section which removes or reduces an image-quality deteriorating component which was generated in a region surrounding the high brightness pixel on the basis of a generated amount obtained by the deterioration detecting section, wherein the deterioration detecting section uses information regarding image-forming properties of the optical system when detecting or estimating the image-quality deteriorating component.