1. An X-ray apparatus configured to obtain a reference mask image of a subject and a live image of the subject which includes information to be examined and is different from the reference mask image, and extract the information from the live image based on the reference mask image, the X-ray apparatus comprising: an X-ray irradiating device for irradiating a subject with X-rays; an X-ray detector for detecting X-rays transmitting through the subject; an imaging-condition setting section for setting X-ray imaging conditions for the X-ray irradiating device to irradiate the subject with the X-rays; a mask-image taking time calculating section for (i) setting a first imaging time for obtaining a first mask image of the subject, in accordance with the X-ray imaging conditions, and (ii) calculating a second imaging time for obtaining a mask image of the subject to be taken subsequent to the first mask image in accordance with imaging time and brightness of a mask image taken previously such that average brightness of the mask image taken previously and a mask image to be taken next is target brightness; a live-image taking time calculating section for calculating an imaging time for the live image in accordance with an imaging time of the mask image to which X-rays are emitted from the X-ray irradiating device based on the first imaging time and an imaging time of the mask image to which X-rays are emitted from the X-ray irradiating device based on the second imaging time; and an image processor for receiving detection signals of the X-rays detected by the X-ray detector and calculating a subtraction image based on a difference between the reference mask image and the live image, the reference mask image being obtained through averaging the mask image taken in accordance with the first imaging time and the mask image taken in accordance with the second imaging time.