An x-ray imaging method comprises the steps of: providing a set of at least one training material, the set comprising different materials and/or different thicknesses of the or each material; obtaining observed x-ray images of the at least one training material with a pixelated detector; building a database in a simulator of simulated scatter kernels for variable parameters within the simulator for each of the at least one training material; generating a transfer function between parameters of the simulator and parameters of the observed image which is independent of sample type and thickness; generating a whole image scatter estimate; predicting the direct radiation for each scatter kernel; applying the transfer function to the scatter estimate and the direct radiation or the inverse of the transfer function to the observed intensity values; performing the calculation Z−;S−;D<;threshold to provide scatter free data and/or a scatter free image.