An X ray imaging device (1) and methods for operating such device are presented. In an embodiment the device (1) comprises an X ray source (5) an arrangement (12) of a first grating (13) a second grating (15) and a third grating (17) an X ray detector (7) and a control device (21). The first second and third gratings (13 15 17) are arranged in a beam path (9) of X rays in a region upstream of an observation volume (3). At least one of the second and third gratings (15 17) comprises a multiplicity of sub gratings wherein each of the sub gratings comprises a steering means (39) for displacing the subgrating with respect to the other one of the second and third gratings. The control device (21) is adapted to controlling the steering means (39). Accordingly sub gratings may be positioned such that intensity maxima of an interference pattern generated upon transmission of X rays through the second grating (15) are either arranged such as to coincide with strongly X ray absorbing portions of the third grating (17) or to coincide with weakly X ray absorbing portions in the third grating (17). Accordingly X ray transmission through the arrangement (12) may be locally adapted by specifically positioning each of the sub gratings.