A method for testing a material applied to a surface of a sample includes
directing an excitation beam, having a known beam-width and intensity
cross-section, onto a region of the sample. An intensity of X-ray
fluorescence emitted from the region responsively to the excitation beam
is measured. A distribution of the material within the region is
estimated, responsively to the measured intensity of the X-ray
fluorescence and to the intensity cross-section of the excitation beam,
with a spatial resolution that is finer than the beam-width.