1. An X-ray apparatus, comprising: an X-ray source configured to radiate X-rays onto an object; an X-ray detector configured to detect X-rays having penetrated through the object among the radiated X-rays and obtain pieces of raw data of different energy bands based on the detected X-rays; a raw image obtainer configured to obtain raw images in which different materials constituting the object are enhanced using the pieces of raw data; and an image processor configured to process the raw images and generate an X-ray image of the object based on the processed raw images.