Here we describe a spectral imaging system for minimally invasive identification, localization, and relative quantification of pigments in cells and microbial communities. The modularity of the system allows pigment detection on spatial scales ranging from the single-cell level to regions whose areas are several tens of square centimeters. For pigment identification in vivo absorption and/or autofluorescence spectra are used as the analytical signals. Along with the hardware, which is easy to transport and simple to assemble and allows rapid measurement, we describe newly developed software that allows highly sensitive and pigment-specific analyses of the hyperspectral data. We also propose and describe a number of applications of the system for microbial ecology, including identification of pigments in living cells and high-spatial-resolution imaging of pigments and the associated phototrophic groups in complex microbial communities, such as photosynthetic endolithic biofilms, microbial mats, and intertidal sediments. This system provides new possibilities for studying the role of spatial organization of microorganisms in the ecological functioning of complex benthic microbial communities or for noninvasively monitoring changes in the spatial organization and/or composition of a microbial community in response to changing environmental factors.