A diffraction grating is an optical device or attachment that disperses light into its constituent colours or wavelengths. It works by using a series of closely spaced lines or grooves, which cause incoming light waves to interfere and spread out, producing a spectrum.
In photography and scientific imaging, diffraction gratings are used for studying light properties, creating precise colour separation, and analysing spectral data. They are especially valuable in applications such as spectroscopy, advanced optical experiments, and educational demonstrations of how white light is composed of multiple colours.