Stretching and bending vibrations of water molecules absorb photons of specific wavelengths, a phenomenon that constrains light energy available for aquatic photosynthesis. Previous work suggested that these absorption properties of water create a series of spectral niches but the theory was still too simplified to enable prediction of the spectral niches in real aquatic ecosystems. Here, we show with a state-of-the-art radiative transfer model that the vibrational modes of the water molecule delineate five spectral niches, in the violet, blue, green, orange and red parts of the spectrum. These five niches are effectively captured by chlorophylls and phycobilin pigments of cyanobacteria and their eukaryotic descendants. Global distributions of the spectral niches are predicted by satellite remote sensing and validated with observed large-scale distribution patterns of cyanobacterial pigment types. Our findings provide an elegant explanation for the biogeographical distributions of photosynthetic pigments across the lakes and oceans of our planet.