In generating phase image data 38 first x ray image data 28a comprising first pixel wise measurement signal values 30a and second x ray image data 28b comprising second pixel wise measurement signal values30bare received. The first x ray image data28awas obtained in a first measurement mode and the second x ray image data28b was obtained in a second measurement mode different from the first measurement mode. Phase image data 38 comprising pixel wise phase values 34 from the first and second x ray image data 28a 28bis determined by determining a phase value 34 at a pixel 31 from a first measurement signal value 30a obtained in a first measurement mode at the pixel 31 and a second measurement signal value 30b obtained in a second measurement mode at the pixel 31.