Disclosed is an x-
ray imaging
system comprising an x-
ray source, a sample position, and a
detector arranged to detect x-
ray radiation downstream of the sample position, the x-ray source comprising an
electron source arranged to provide an
electron beam, a target arranged to produce x-
ray radiation upon
impact by the
electron beam, the target comprising a substrate and a target layer at least partially covering the substrate, the target layer arranged to produce x-
ray radiation upon
impact by the electron beam, means for directing the electron beam to a first position on the target layer and a second position selected from a position on the target where the electron beam directly impinges on the substrate and a position on an electron
beam dump arranged such that x-
ray radiation produced by interaction between the electron beam and the electron
beam dump does not substantially reach a
detector, and a controller arranged to use the
detector to direct the electron beam to the first position to
record a first image and to direct the electron beam to the second position to
record a second image, and to generate an image that differs between the first image and the second image. A method for x-ray imaging is also disclosed.