1. An X-ray apparatus with an X-ray irradiation section for irradiating a subject with X-rays, an X-ray detector for detecting X-rays transmitting through the subject, and an X-ray grid disposed on an incidence surface side of the X-ray detector for removing scattered rays, comprising: a pixel-extracting section for extracting pixels determined in advance in each line perpendicular to a grid moiré pattern of an image, the grid moiré pattern by the X-ray grid being contained in the image; a Fast Fourier Transform processing section for performing one-dimensional Fast Fourier Transform to the pixels extracted by the pixel-extracting section; a peak-frequency detecting section for detecting a peak frequency from a frequency characteristic for each line calculated by the Fast Fourier Transform processing section, the peak frequency being a frequency component of the grid moiré pattern; a frequency-characteristic preparing section for preparing a frequency characteristic for extracting a grid moiré pattern image in accordance with the peak-frequency; an inverse Fast Fourier Transform processing section for performing inverse Fast Fourier Transform to the frequency characteristic prepared by the frequency-characteristic preparing section; and an FIR filtering section for performing FIR filtering on the image with use of a value calculated by the inverse Fast Fourier Transform processing section as an FIR filter coefficient.