X-ray powder diffraction is one of the few analytical techniques that can unambiguously identify chemical species in a wide range of materials. The possibilities of transforming this method into a technique for microscopic analytical imaging of heterogeneous materials were explored. Most of the work was concentrated on the bottleneck that prevented this transformation from becoming fully operational, namely the automated processing of large amounts of diffraction images. This issue was overcome by the development of a data evaluation software tool, i.e. XRDUA, that was made available as freeware on the internet (see the dedicated XRDUA webpage). Experiments on a large number of case studies demonstrated that the combination of microscopy with the penetrative power of X-rays and the speciation capacity of powder diffraction is a particularly powerful imaging and characterization tool for materials commonly encountered in environmental and earth sciences, material science, chemistry and cultural heritage.