An image processing apparatus, an image processing method, and an image processing program, capable of correcting staining variation using an image processing including a function to virtually adjust a staining dye amount, without causing unnatural color variation in an image, are provided. To this end, a spectrum of an object is estimated based on image information regarding an image, a plurality of dye amounts included in the object are estimated from the estimated spectrum of the object, a first spectrum is synthesized using the plurality of dye amounts, and the synthesized first spectrum is subtracted from the spectrum of the object, thereby calculating a difference spectrum; on the other hand, at least a part of a plurality of estimated dye amounts is corrected, a second spectrum is synthesized using the corrected dye amount, and after that, a third spectrum is synthesized by adding the synthesized second spectrum and the difference spectrum, and a display image is synthesized from the synthesized third spectrum.