A system and method for generating phase image data by using the same detector to simultaneously operate in two different modes to simultaneously obtain first and second x-ray image data with different spectral weightings. The first and second x-ray image data respectively include first and second pixel-wise measurement signal values. The detector is configured to obtain the first x-ray image data in a first measurement mode and obtain the second x-ray image data in a second measurement mode different from the first measurement mode for generating the phase image data. The generated phase image data includes pixel-wise phase values from the first and second x-ray image data and is determined by determining a phase value at a pixel from a first measurement signal value obtained in the first measurement mode at the pixel, and from a second measurement signal value obtained in the second measurement mode at the pixel.