In images of sedimentary or granular material, or simulations of binary (two-phase) granular media, in which the individual grains are resolved, the complete size distribution of apparent grain axes is well-approximated by the global power spectral density function derived using a Morlet wavelet. This approach overcomes many limitations of previous automated methods for estimating the grain-size distribution from images, all of which rely on either: identification and segmentation of individual grains; calibration and/or relatively large sample sizes. The new method presented here is tested using: (i) various types of simulations of two-phase media with a size distribution, with and without preferred orientation; (ii) 300 sample images drawn from 46 populations of sands and gravels from around the world, displaying a wide variability in origin (biogenic and mineralogical), size, surface texture and shape; (iii) petrographic thin section samples from nine populations of sedimentary rock; (iv) high-resolution scans of marine sediment cores; and (v) nonsedimentary natural granular patterns including sea ice and patterned ground. The grain-size distribution obtained is equivalent to the distribution of apparent intermediate grain diameters, grid by number style. For images containing sufficient well-resolved grains, root mean square errors are within tens of percent for percentiles across the entire grain-size distribution. As such, this method is the first of its type which is completely transferable, unmodified, without calibration, for both consolidated and unconsolidated sediment, isotropic and anisotropic two-phase media, and even non-sedimentary granular patterns. The success of the wavelet approach is due, in part, to it quantifying both spectral and spatial information from the sediment image simultaneously, something which no previously developed technique is able to do.