An image processing apparatus, an image processing method, and an image processing program capable of accurately distinguishing between an abnormal portion and another object that has the same type of color information as the abnormal portion are provided. The image processing apparatus includes an abnormal portion candidate region detection unit 110 configured to detect 3+3 candidate regions of abnormal portions based on color information of each pixel constituting an image obtained by capturing an image of an inside of a lumen of a subject, a border neighboring pixel identifying unit 120 configured to identify a border neighboring pixel which is a pixel existing in proximity to a border of the candidate region, a feature data calculation unit 130 configured to calculate feature data based on a pixel value of the border neighboring pixel, and an abnormal portion region distinguishing unit 140 configured to distinguish an abnormal portion region based on the feature data.