An image processing apparatus includes: a subtraction unit that generates subtraction images constituted by a plurality of frames from X-ray images of an object acquired before and after injecting a radiopaque dye an evaluation unit that calculates evaluation values indicating states of the injection of the radiopaque dye for the frames constituting the subtraction images and a selection unit that selects at least one of the frames constituting the subtraction images using the evaluation values and outputs the selected frame as a reference image.