An X-
ray imaging
system is disclosed, comprising an X-
ray source; a sample position; a
detector arranged to detect X-
ray radiation downstream of said sample position; wherein said X-ray source comprises an
electron source arranged to provide an
electron beam; a target arranged to produce X-
ray radiation upon
impact by said
electron beam, the target comprising a substrate and a target layer at least partly covering said substrate, wherein said target layer is arranged to produce X-
ray radiation upon
impact by said electron beam; means for directing the electron beam to a first position on said target layer and a second position selected from a position on said target at which the electron beam impacts directly upon the substrate and a position on an electron
beam dump arranged so that substantially no X-
ray radiation created by interaction between the electron beam and the electron
beam dump reaches the
detector; a controller arranged to
record, using said
detector, a first image with the electron beam directed to said first position, and a second image with the electron beam directed to said second position, and generate a difference image between the first image and the second image. A method for X-ray imaging is also disclosed.