In color reproduction, including computer graphics and photography, the gamut, or color gamut /ˈɡæmət/, is a certain complete subset of colors. The most common usage refers to the subset of colors which can be accurately represented in a given circumstance, such as within a given color space or by a certain output device.
Another sense, less frequently used but still correct, refers to the complete set of colors found within an image at a given time. In this context, digitizing a photograph, converting a digitized image to a different color space, or outputting it to a given medium using a certain output device generally alters its gamut, in the sense that some of the colors in the originals are lost in the process.
The term gamut was adopted from the field of music, where it means the set of pitches of which musical melodies are composed; Shakespeare's use of the term in The Taming of the Shrew is sometimes attributed to the author/musician Thomas Morley. In the 1850s, the term was applied to a range of colors or hues, for example by Thomas De Quincey, who wrote "Porphyry, I have heard, runs through as large a gamut of hues as marble."
In color theory, the gamut of a device or process is that portion of the color space that can be represented, or reproduced. Generally, the color gamut is specified in the hue–saturation plane, as a system can usually produce colors over a wide intensity range within its color gamut; for a subtractive color system (such as used in printing), the range of intensity available in the system is for the most part meaningless without considering system-specific properties (such as the illumination of the ink).
When certain colors cannot be expressed within a particular color model, those colors are said to be out of gamut. For example, while pure red can be expressed in the RGB color space, it cannot be expressed in the CMYK color space; pure red is out of gamut in the CMYK color space.
A device that can reproduce the entire visible color space is an unrealized goal within the engineering of color displays and printing processes. Modern techniques allow increasingly good approximations, but the complexity of these systems often makes them impractical.
While processing a digital image, the most convenient color model used is the RGB model. Printing the image requires transforming the image from the original RGB color space to the printer's CMYK color space. During this process, the colors from the RGB which are out of gamut must be somehow converted to approximate values within the CMYK space gamut. Simply trimming only the colors which are out of gamut to the closest colors in the destination space would burn the image. There are several algorithms approximating this transformation, but none of them can be truly perfect since those colors are simply out of the target device's capabilities. This is why identifying the colors in an image that are out of gamut in the target color space as soon as possible during processing is critical for the quality of the final product.