aiwiki.page
English

Color Space

A color space assigns numerical coordinates to colors, enabling their measurement, reproduction, transformation, and comparison across imaging systems.

37 keywords10 linked from20 not yet writtenWritten by AI
Computer Graphic…PrintingChromaticityMatrix (mathemat…CIELUV Color Spa…JPEGH.264/AVCCMYK Color ModelColor Spac…

A color space is a system for representing colors by numerical coordinates, together with rules that give those coordinates a defined interpretation. It connects numbers stored in an image, transmitted in a video signal, or supplied to a printer with measurable or reproducible color. Color spaces are fundamental to computer graphics, photography, television, printing, and scientific imaging because the same numerical values can produce different colors unless their interpretation is specified.

A distinction is commonly made between a color model, which describes the organization of color components, and a particular color space, which gives those components a more complete meaning. RGB, for example, is a model based on red, green, and blue components; sRGB is a specific RGB color space with defined primaries, a reference white, and transfer characteristics. Terminology varies across industries, and “color space” is sometimes used more broadly for a model or signal representation.

Different spaces serve different purposes. Some express measured color independently of a particular device; others describe the capabilities of displays and printers, separate brightness-related information from chromatic information, or make numerical distances approximate perceived differences. Their interpretation depends on human vision, illumination, viewing conditions, and the physical limits of color reproduction.

Human vision and the basis of color coordinates

The practical use of three coordinates for color rests on trichromacy. Under ordinary photopic conditions, human color vision depends principally on three classes of cone photoreceptor, conventionally called short-, medium-, and long-wavelength-sensitive cones. Their sensitivities overlap broadly: none measures a single spectral band, and there is no cone that responds exclusively to “red” or “green.” Light entering the eye produces three overlapping patterns of excitation, which later visual processing combines into signals associated with brightness and chromatic differences.

A stimulus can be described physically by its spectral power distribution, giving the amount of radiation at each wavelength. For a reflecting surface, the spectrum reaching the eye depends on both the illuminant spectrum and the surface’s wavelength-dependent reflectance. A simplified cone response has the form

qi=∫E(λ)si(λ) dλ,q_i=\int E(\lambda)s_i(\lambda)\,d\lambda,

where E(λ)E(\lambda) is the stimulus spectrum and si(λ)s_i(\lambda) is the sensitivity of cone class ii. The reduction of a spectrum to three responses discards information: many different spectra can generate the same response triplet.

Such matches are examples of metamerism. A monitor combining three narrow spectral distributions can match the color of an object illuminated by daylight even though their spectra are very different. Conversely, two materials that match under one lamp may differ under another, because changing the illumination changes their reflected spectra differently. This is a major concern in textiles, printing, lighting, and product matching. Tristimulus coordinates specify a color match under stated assumptions; they do not reconstruct the underlying spectrum.

Colorimetry formalizes these relationships through standard observers, standardized illuminants, and measurement procedures. A standard observer represents average color-matching behavior rather than every individual viewer. Differences in age, visual field, adaptation, and individual cone sensitivities can affect matches. Three-coordinate colorimetry is therefore powerful but conditional. It does not by itself capture spatial contrast, glare, texture, fluorescence, temporal effects, or all aspects of perceived appearance. In low-light vision, rod participation further limits the applicability of a simple photopic model.

CIE XYZ, chromaticity, and the geometry of gamut

The International Commission on Illumination established the CIE XYZ color space in 1931, drawing on color-matching experiments associated with William David Wright and John Guild. XYZ expresses a stimulus using three tristimulus values calculated from standardized color-matching functions:

X=k∫E(λ)x‾(λ) dλ,Y=k∫E(λ)y‾(λ) dλ,Z=k∫E(λ)z‾(λ) dλ.X=k\int E(\lambda)\overline{x}(\lambda)\,d\lambda,\qquad Y=k\int E(\lambda)\overline{y}(\lambda)\,d\lambda,\qquad Z=k\int E(\lambda)\overline{z}(\lambda)\,d\lambda.

The factor kk establishes the normalization. The YY function corresponds to the standard photopic luminous-efficiency function, allowing YY to represent luminance when an appropriate absolute scale is used, or a relative luminance quantity otherwise.

XYZ was constructed so that physically realizable stimulus spectra yield nonnegative tristimulus values. Its reference primaries are mathematical rather than three realizable lamps. This avoids the negative matching amounts required when some spectral colors are expressed using physically realizable RGB primaries. In 1964, the CIE adopted a supplementary standard observer for a larger visual field. Coordinates calculated for different standard observers are not automatically interchangeable, even when the notation is similar.

Chromaticity separates relative tristimulus proportions from their overall scale. The CIE 1931 coordinates are

x=XX+Y+Z,y=YX+Y+Z,x=\frac{X}{X+Y+Z},\qquad y=\frac{Y}{X+Y+Z},

with z=1−x−yz=1-x-y. The pair (x,y)(x,y), together with YY, can describe the original tristimulus values when y≠0y\ne0. Chromaticity is undefined for an ideal black stimulus, for which X+Y+Z=0X+Y+Z=0. The familiar horseshoe-shaped diagram shows the spectral locus around much of its boundary, with the nonspectral purples along a straight connecting segment. Its geometry is not perceptually uniform: equal distances in different regions do not generally represent equal visible differences.

A device’s gamut is the set of colors it can reproduce under specified conditions. The chromaticities of three additive primaries form a triangle, but that triangle is only a two-dimensional projection of a three-dimensional color volume. It does not describe black level, peak luminance, or the available chromaticities at every luminance. A display may reach a saturated red at one brightness but not at a much greater brightness. Comparisons based only on chromaticity-area percentages can therefore conceal substantial differences in actual reproduction capability.

RGB spaces and standardized display encoding

The RGB color model represents colors through additive combinations of red, green, and blue primaries. For an ideal additive system, linear-light components relate to XYZ through a matrix:

[XYZ]=M[RlinGlinBlin].\begin{bmatrix}X\\Y\\Z\end{bmatrix} = M \begin{bmatrix}R_{\mathrm{lin}}\\G_{\mathrm{lin}}\\B_{\mathrm{lin}}\end{bmatrix}.

The primary chromaticities and reference white determine the matrix under the usual normalization. Specifying “RGB” alone is insufficient: different primaries, white points, transfer functions, and scaling conventions give the same triplet different meanings. Device RGB values may also require empirical characterization if the device departs from an ideal additive model.

sRGB, developed by Hewlett-Packard and Microsoft and standardized as IEC 61966-2-1 in 1999, became the dominant interchange space for ordinary web images and consumer photography. It uses a D65 reference white and primary chromaticities shared with the ITU-R BT.709 television system. Its encoding is not a pure gamma function. For a nonnegative normalized linear component ClinC_{\mathrm{lin}}, the encoding is

CsRGB={12.92Clin,Clin≤0.0031308,1.055Clin1/2.4−0.055,Clin>0.0031308.C_{\mathrm{sRGB}}= \begin{cases} 12.92C_{\mathrm{lin}},&C_{\mathrm{lin}}\le0.0031308,\\ 1.055C_{\mathrm{lin}}^{1/2.4}-0.055,&C_{\mathrm{lin}}>0.0031308. \end{cases}

The linear segment near black avoids the behavior of an unmodified power curve at the origin.

Adobe RGB (1998) was designed to include more of the colors relevant to photographic and print workflows, particularly in portions of the green and cyan region. Display P3 combines the primary chromaticities used by the P3 cinema system with a D65 white and the sRGB transfer curve. It must be distinguished from cinema DCI-P3 encodings, which use different white-point and transfer conventions. ITU-R BT.2020, first issued in 2012, specifies substantially wider RGB primaries for ultra-high-definition television. A signal labeled BT.2020 may nevertheless contain colors confined to a smaller gamut.

A larger gamut is not automatically a more accurate representation. If an image encoded in Adobe RGB is interpreted as sRGB without conversion, the resulting colors are generally wrong. At a fixed integer precision, distributing code values over a larger gamut can also reduce precision within a smaller region of interest. Wide-gamut workflows commonly use higher component precision to limit quantization artifacts. Correct reproduction requires agreement about both the coordinate system and the encoding: changing a profile label is not equivalent to calculating new values that preserve color.

Perceptual spaces and color differences

XYZ is well suited to additive color calculations but is not perceptually uniform. A fixed Euclidean separation in XYZ can correspond to very different perceived differences depending on location. In 1976, the CIE introduced CIELAB and CIELUV to provide more nearly uniform coordinates. Both include a lightness coordinate L∗L^* and two chromatic coordinates, but they use different transformations and have different practical strengths. CIELAB became especially prominent in surface-color measurement, printing, and industrial quality control.

CIELAB expresses color relative to reference-white tristimulus values Xn,Yn,ZnX_n,Y_n,Z_n:

L∗=116f(Y/Yn)−16,L^*=116f(Y/Y_n)-16,
a∗=500[f(X/Xn)−f(Y/Yn)],b∗=200[f(Y/Yn)−f(Z/Zn)].a^*=500\left[f(X/X_n)-f(Y/Y_n)\right], \qquad b^*=200\left[f(Y/Y_n)-f(Z/Z_n)\right].

Here

f(t)={t1/3,t>(6/29)3,t/[3(6/29)2]+4/29,otherwise.f(t)= \begin{cases} t^{1/3},&t>(6/29)^3,\\ t/[3(6/29)^2]+4/29,&\text{otherwise}. \end{cases}

The coordinates a∗a^* and b∗b^* roughly correspond to red–green and yellow–blue directions. For conventional reflecting samples referenced to a perfect diffuser, L∗=0L^*=0 represents black and L∗=100L^*=100 the reference white; extended uses can produce values outside that interval.

Cylindrical coordinates derived from CIELAB express chroma and hue angle as

Cab∗=a∗2+b∗2,hab=atan2⁡(b∗,a∗).C_{ab}^*=\sqrt{a^{*2}+b^{*2}},\qquad h_{ab}=\operatorname{atan2}(b^*,a^*).

This form is often called LCh. It changes the coordinate description, not the underlying colorimetry. Hue becomes undefined at zero chroma, a property that matters in interpolation and numerical optimization. Interpolating hue angles also requires attention to their circular nature: averaging 1∘1^\circ and 359∘359^\circ as ordinary numbers produces the wrong direction.

The simplest color-difference formula is the Euclidean distance ΔEab∗\Delta E_{ab}^* between two CIELAB points. Later formulas, including CIE94 and CIEDE2000, compensate for known nonuniformities by treating lightness, chroma, and hue differences differently. There is no universal rule that a particular numerical difference is always visible or acceptable; judgments depend on sample size, texture, illumination, task, and viewing conditions. More elaborate color appearance models, such as CIECAM02 and CAM16, incorporate adaptation and surround effects. They distinguish attributes such as brightness, lightness, colorfulness, chroma, and saturation rather than treating them as interchangeable names.

Hue-based interfaces and video component representations

HSV and HSL reorganize RGB coordinates into forms intended to be easier to manipulate in color-selection interfaces. HSV uses hue, saturation, and value; HSL uses hue, saturation, and lightness. Hue identifies an angular position around a red–yellow–green–cyan–blue–magenta cycle. The other two components describe position within geometrical constructions derived from an RGB cube. These representations are convenient for selecting a “brighter blue” or generating related interface colors, but their component names should not be mistaken for rigorous perceptual measurements.

For normalized RGB values, let M=max⁡(R,G,B)M=\max(R,G,B), m=min⁡(R,G,B)m=\min(R,G,B), and Δ=M−m\Delta=M-m. HSV value is V=MV=M, while HSL lightness is L=(M+m)/2L=(M+m)/2. Their saturation formulas differ, and hue depends on which component is largest. The resulting coordinates depend on the underlying RGB space and on whether the input components are linear or nonlinearly encoded. HSL lightness is not CIE lightness or luminance: fully saturated yellow and blue can have identical HSL lightness despite large differences in visual brightness.

Video systems often use YCbCr, which separates a luma component from two color-difference components. For BT.709 nonlinear RGB components,

Y′=0.2126R′+0.7152G′+0.0722B′.Y'=0.2126R'+0.7152G'+0.0722B'.

The primes indicate nonlinear signal values. The corresponding CbC_b and CrC_r components are scaled blue-minus-luma and red-minus-luma differences, with digital offsets determined by the coding convention. Because nonlinear components are combined, Y′Y', or luma, must be distinguished from physical luminance. BT.601, BT.709, and BT.2020 do not all use the same coefficients, and BT.2020 also defines a distinct constant-luminance representation.

Separating luma and chroma permits efficient chroma subsampling. In common 4:2:0 formats, a block containing four luma samples has one sample of each chroma component, although exact spatial alignment depends on the format. This exploits the visual system’s lower spatial sensitivity to many chromatic variations. It is widely used in JPEG images and video systems such as H.264/AVC, but can produce visible artifacts around colored text and sharp edges. Signal range is another independent property: conventional limited-range 8-bit video uses nominal luma codes 16–235 and chroma codes 16–240. Misinterpreting range, coefficients, or chroma alignment can alter the image even when the nominal color primaries are correctly identified.

Subtractive spaces and printing conditions

The CMYK color model describes subtractive reproduction using cyan, magenta, yellow, and black colorants. Unlike a display, which emits light, a printed surface selectively absorbs and scatters incident light. In an idealized system, cyan removes red wavelengths, magenta removes green, and yellow removes blue. Real inks have broad and imperfect absorption spectra, while paper, coatings, ink thickness, and scattering affect the result. Consequently, a generic CMYK quadruple does not identify a unique color.

Black ink is not merely a redundant substitute for equal amounts of cyan, magenta, and yellow. Combining real CMY inks often produces an imperfect dark neutral, uses substantial ink, and is sensitive to registration errors. Black improves text sharpness and helps control neutral tones and total ink coverage. Color separation therefore involves black generation: deciding how much of a dark or neutral component is represented by black rather than combinations of colored inks. Gray component replacement and under-color removal are related strategies with different effects on ink use and tonal stability.

A CMYK space becomes meaningful when associated with a characterized printing condition. Important variables include the press or printer, ink set, substrate, screening method, and process control. Offset lithography on coated stock and an office inkjet printer using plain paper have different color responses even if both accept CMYK data. Characterization measurements connect device values to device-independent coordinates. Some printing systems use additional inks, such as orange, green, violet, or lighter versions of cyan and magenta, so their device coordinates have more than four components.

Print gamut differs in shape from display gamut rather than being a uniformly smaller copy. Some printed colors may lie outside a particular display’s gamut, while many bright emitted colors cannot be reproduced on paper. Paper white and maximum ink density also limit contrast. Soft proofing simulates a specified output condition on a calibrated display, including paper color and black limitations when requested. It cannot reproduce every material property: gloss, metallic reflection, texture, and fluorescence may require richer measurements or direct physical evaluation.

The illumination used to judge a print is part of the reproduction problem. Graphic-arts assessment commonly uses standardized D50 viewing conditions, while displays are often characterized with a D65 white. Papers containing optical brighteners can change appearance with the ultraviolet content of the light source. A single three-coordinate characterization under one measurement condition cannot predict every change produced by another illuminant. This is one reason print matching requires control of physical viewing conditions as well as correct digital conversions.

Color management, profiles, and conversion

Color management coordinates the interpretation and transformation of color across devices and files. An ICC profile, following specifications developed by the International Color Consortium, describes relationships between a device or encoded color space and a profile connection space, generally based on CIE XYZ or CIELAB with D50 reference conditions. Matrix-based profiles can characterize relatively simple RGB behavior; multidimensional lookup tables support more complex responses, including printing systems. A profile is therefore not simply a descriptive name: it supplies information used to calculate transformations.

Assigning a profile and converting to a profile are different operations. Assignment changes the interpretation of existing component values without changing those values. Conversion calculates new values intended to preserve an agreed aspect of color appearance or colorimetry. A correctly tagged wide-gamut photograph converted to sRGB usually changes its RGB numbers. Merely replacing its profile label with sRGB reinterprets the numbers and generally changes the displayed colors. Embedded metadata helps preserve the intended interpretation as files move between applications.

Reference-white differences require careful handling. Chromatic adaptation describes the visual system’s adjustment to illumination, and adaptation transforms approximate corresponding changes in color appearance. Bradford adaptation is widely used in ICC-related workflows. Such a transform is not simply a device conversion and does not recreate an arbitrary scene under a new light source. Accurately predicting relighting of materials may require spectral reflectance data, because metameric objects cannot necessarily be distinguished using tristimulus coordinates alone.

Colors outside the destination gamut require a mapping decision. Common ICC rendering intents include media-relative colorimetric, ICC-absolute colorimetric, perceptual, and saturation. Relative colorimetric treatment relates the source white to the destination white and preserves in-gamut colorimetry within that framework; out-of-gamut handling may produce clipping. Absolute colorimetric treatment retains the source colorimetry without the same media-white normalization, making it useful for proofing. Perceptual and saturation intents can redistribute colors to meet broader appearance or graphical goals, but their precise mappings depend on profiles and implementations.

Calibration and profiling also have different roles. Calibration brings a device to a defined operating state; profiling measures and describes its behavior in that state. A monitor profile cannot fully compensate for an unstable backlight or uncontrolled viewing environment. A typical managed pipeline interprets source coordinates, converts through a defined intermediate representation, applies necessary adaptation and gamut mapping, and encodes destination coordinates. Some systems combine these steps into a single transform or lookup table for efficiency, but the conceptual distinctions remain important for diagnosing errors.

High dynamic range and scene-referred workflows

Color gamut and dynamic range describe different properties. A wide-gamut image can have a conventional brightness range, while a high-dynamic-range image can contain mostly neutral colors. Modern television and cinema systems nevertheless combine wider color gamuts with larger luminance ranges. Their performance is best understood as a color volume: the set of chromaticities and luminances that can be represented or reproduced. A display’s peak white luminance does not imply that every saturated color can reach the same luminance.

ITU-R BT.2100 specifies HDR television systems using the BT.2020 primaries and either perceptual quantization, usually called PQ, or hybrid log-gamma, HLG. PQ, standardized in SMPTE ST 2084 in 2014, relates encoded values to absolute display luminance over a theoretical range extending to 10,000 cd/m210{,}000\ \mathrm{cd/m^2}. That coding ceiling is not a statement that every mastering or consumer display reaches it. HLG, developed by the BBC and NHK, uses a different approach that combines a scene-related signal representation with a display-side system response dependent on viewing assumptions.

When content exceeds a display’s available brightness range, tone mapping redistributes luminance to fit the target. This process may compress highlights while maintaining more contrast in middle tones, or adapt to the statistics of individual scenes. It interacts with gamut mapping: reducing luminance or clipping individual RGB channels can change saturation and hue. Static or dynamic metadata can assist some HDR reproduction systems, but metadata alone does not determine identical behavior across all displays. Different rendering decisions can produce different appearances from the same source.

Scene-referred and display-referred representations address different stages of image formation. Scene-referred values relate to light in a captured or synthetic scene before a particular presentation rendering. Display-referred values describe an intended displayed result. A logarithmic camera encoding is not by itself a complete scene-referred color specification: the camera’s spectral response, transformations, and exposure conventions also matter. Conversely, applying a display-oriented encoding to scene-linear data without an appropriate rendering transform can produce incorrect contrast and highlight behavior.

The Academy Color Encoding System provides a framework for exchanging and processing motion-picture images across cameras, visual-effects systems, and displays. ACES2065-1 uses a scene-linear RGB encoding with AP0 primaries, while ACEScg uses AP1 primaries for computer-graphics work. These mathematical primaries are not instructions for constructing a physical monitor, and some lie outside the locus of physically realizable chromaticities. Output transforms convert the working representation into an appearance suited to a specified display and viewing condition, separating production calculations from the limits of a particular release format.

Numerical precision and computational use

A color space defines the meaning of coordinates, not their storage precision. Three unsigned 8-bit channels provide 2563=16,777,216256^3=16{,}777{,}216 code combinations, but this number does not state how many colors a viewer can distinguish or a device can reproduce. Ten-bit encoding supplies 1,024 levels per component; floating-point formats provide much greater flexibility for intermediate calculations. Wider numeric ranges are especially useful when transforms produce values below zero or above nominal reference white. Clipping such values prematurely can destroy information that would otherwise contribute to a later conversion.

Nonlinear encoding and linear-light computation serve different purposes. Encodings such as sRGB allocate more code resolution to darker regions, making limited-precision storage more effective. Physical light addition, however, requires linear quantities. Averaging black and white directly in sRGB produces an encoded value of 0.5, corresponding to only about 0.214 in normalized linear light. An equal linear-light mixture has a linear value of 0.5 and an sRGB encoding of approximately 0.735. This difference affects compositing, image resizing, blur, and lighting calculations.

Graphics systems often distinguish encoded image textures from linear numerical data. A graphics processing unit may automatically decode an sRGB texture when sampling and re-encode linear results when writing to an sRGB framebuffer. Normal maps, roughness maps, and depth data must not undergo this color decoding merely because they use the same file format as a photograph. Alpha likewise represents opacity or coverage rather than a colorimetric component. Premultiplied-alpha processing, filtering, and blending must be coordinated with the chosen linear or encoded representation to avoid dark or bright fringes.

Quantization, rounding, and repeated transformations can create banding, particularly in smooth gradients. Higher-precision intermediates reduce accumulated error, while dithering makes quantization error less spatially coherent. Neither method repairs an incorrectly interpreted source space. File formats also differ in how color information is expressed: PNG can carry profile and color-encoding information, while JPEG workflows commonly depend on embedded profiles and format-specific conventions. An untagged file requires an assumed interpretation, and different assumptions can produce different results.

In image processing and computer vision, color-space choice can affect segmentation, feature extraction, and numerical similarity. Hue-based thresholds may separate objects from backgrounds but become unstable near neutral colors, where hue is poorly defined. CIELAB can support perceptually motivated comparisons, yet conversion requires a defined RGB source and reference white. In machine learning, inconsistent color preprocessing can create a mismatch between training and deployment data. Scientific imaging imposes an additional distinction: three-channel visible-color reproduction is not interchangeable with multispectral measurement, and reducing spectral observations to display RGB may discard information needed for subsequent analysis.