An electron beam stops on one pixel of a polished rock after another, and an X-ray detector counts photons whose energies name the elements. Software turns the counts into minerals and builds a map. Collect too few photons and similar minerals are confused; let the probe spread and the grain boundaries blur.