The present invention relates to an apparatus for generating dual energy X-ray imaging data. It is described to position (210) an X-ray detector relative to an X-ray source such that at least a part of a region between the X-ray source and the X-ray detector is an examination region for accommodating an object. A grid filter is positioned (220) between the examination region and the X-ray source. The X-ray source produces (230) a focal spot on a target to produce X-rays. The X-ray source moves (240) the focal spot in a first direction across a surface of the target. The grid filter has a structure in a first orientation such that the movement of the focal spot in the first direction results in an associated change in an intensity of X-rays transmitted by the grid filter. The X-ray source moves (250) the focal spot in a second direction across the surface of the target that is orthogonal to the first direction. The grid filter has a structure in a second orientation orthogonal to the first orientation such that the movement of the focal spot in the second direction results in an associated change in an energy spectrum of X-rays transmitted by the grid filter. The X-ray detector detects (260) at least some of the X-rays transmitted by the grid filter.