The present invention relates to an apparatus for generating X-rays. It is described to produce (210) with a power supply (30) a voltage. A cathode (22) of an X-ray source (20) is positioned (220) relative to an anode (24) of the X-ray source. Electrons are emitted (230) from the cathode. Electrons emitted from the cathode interact (240) with the anode with energies corresponding to the voltage. X-rays are generated (250) from the anode, wherein the electrons interact with the anode to generate the X-rays. The X-ray source is controlled (260), such that a plurality of first X-ray pulses is generated each having a first X-ray flux, wherein the first X-ray pulses are temporally separated from each other. The X-ray source is controlled (270), such that a least one second X-ray pulse is generated having a second X-ray flux that is substantially less than the first X-ray flux, wherein the at least one second X-ray pulse is generated temporally between consecutive pulses of the first X-ray pulses.