Colorspaces.
From how the eye works to colour spaces: gamuts, dynamic range, printing, bit depth and channels. How a colour is captured, encoded and reproduced.
Vision
The light reaching the eye has no colour: it is a mix of wavelengths, which every surface unbalances by absorbing some of them. Our cones measure that imbalance, and the brain builds a colour from it. Colour is therefore not a property of the physical world but a sensation; a colour space is only a translation system, from light to numbers, then from numbers back to light, to recreate the same sensation.
The iris, a biological aperture
The iris closes in bright light and opens in the dark: the pupil goes from about 2 to 8 mm, sixteen times more light, four stops. With a focal length of about 17 mm, the eye therefore opens from roughly f/2 to f/8; the lens beside it follows the same aperture with its blades. But the iris handles only a small part of our adaptation: most of it happens in the retina, which tunes its sensitivity over seconds to minutes. That is why the world almost always looks “well exposed” to us, while a sensor keeps the same range from one shot to the next.
3D Gamut
From colour-matching experiments carried out in the 1920s by Wright and Guild, the CIE built a mathematical space in 1931, XYZ, where every colour sensation occupies a point. Setting brightness aside gives the famous horseshoe diagram: the map of every chromaticity the human eye can perceive. RGB spaces appear on it as triangles, and as volumes once lightness is added.
CIE 1931 xy diagram
Reading the volumes
Every RGB space is a volume: all the colours it can encode, from black to white. Here each volume sits in CIELAB, a space built around perception: L* (vertical) is lightness, a* and b* (horizontal) are hue and saturation. The further a volume spreads from the central axis, the more saturated the colours the space can encode. The volume is a distorted cube: its eight corners are black, white, the three primaries and their three pairwise mixes. Colours your screen cannot show are displayed as close as it allows.
The percentages are the share of the CIE 1931 chromaticity diagram covered by the primaries' triangle, and the share of Pointer's gamut, the colours of real objects measured in 1980. ACEScg barely spills outside the visible; ACES2065-1 encloses all of it, thanks to imaginary primaries: part of its triangle stands for colours that do not exist. That is on purpose, for an archive space that must lose no colour.
Relative or absolute: RGB on its own is a relative model, “100% red” means nothing until you say which red. sRGB, P3 and Rec.2020 use the same RGB model; only the position of their primaries changes, fixed in absolute coordinates in the CIE space. Cameras and screens almost never share the same native space, and that is fine: as long as the primaries are known, conversion is unambiguous, from source RGB to XYZ, then to the destination RGB. That is what colour space transforms are for, and the reason ACES exists.
Dynamic range
Dynamic range: blown highlights
In this room, the sky seen through the window is almost three hundred times brighter than Sophia's face, in backlight: about eight stops apart, more than nine with the darkest corners of the ceiling; the sunlit façades sit six stops above the face. A sensor cannot keep everything at once. Expose for the face and the window goes past white: it is clipped, “blown out”. Expose for the window and the face falls into black.
In 8 bits (JPEG), everything beyond white at capture is lost: lowering the exposure in grading only brings back a flat grey patch, with no detail (red zebras). In RAW or float, values beyond white are kept: the same correction brings the sky and the garden back. A real RAW also has a limit, sensor saturation, but it keeps much more headroom than a JPEG; a 3D render saved as float EXR, like this one, has almost none.
RGB and CMYK
Screen and print: RGB and CMYK
A screen makes colour with light: three sources, red, green and blue, that add up. Black is the screen turned off; red and green together give yellow, all three give white. That is additive synthesis.
Printing starts from the white of the paper and takes light away: each ink absorbs part of the spectrum. Cyan absorbs red, magenta absorbs green, yellow absorbs blue; two overprinted inks give a screen primary (magenta and yellow: red). That is subtractive synthesis. In theory all three give black; in practice, a dark greyish brown, less dense than a true black (compare with the K disc). So a black ink is added, the K, denser and cheaper, and total ink coverage is limited: 330% at most for offset on coated paper (Fogra39).
The two gamuts do not overlap neatly. sRGB reaches much further into blues, violets, reds and magentas; offset goes beyond it in cyans, in greens leaning towards cyan and, slightly, in yellows. The diagram compares the corners of both gamuts, the pure colours and their pairwise mixes, from the target values of the ISO 12647-2 standard for offset on coated paper. Between the corners the real boundary is curved: only a printing profile, such as Fogra39, describes it in full. That is why brand guidelines give separate RGB and CMYK colours, each tuned to its medium.
Bits and channels
The fineness of shades
An image stores each channel with a fixed number of levels: 256 in 8 bits, 65,536 in 16 bits; in float (16-bit “half” or 32-bit), decimal numbers are stored, with no visible steps and no ceiling at 1. As long as nothing is touched, 256 levels are enough for the eye. But as soon as grading pushes the image, for instance by lifting the shadows of a dusk sky, the gaps between two levels widen and turn into bands, especially in dark tones and smooth gradients: that is banding. A 16-bit or float image keeps enough shades to be stretched without breaking.
Glossary
- RAW
- Generic name for a digital image file straight from a camera or scanner. Holds the raw sensor data plus the processing parameters, with no irreversible transformation - like undeveloped film, it can be reworked without damage. Larger than a JPEG. Extensions: .cr2 (Canon), .nef (Nikon), .arw (Sony), .dng.
- JPEG (.jpg)
- Compressed 8-bit, lossy format. The standard for the web and consumer photography. Once clipped or overwritten, the information is lost: no recovery possible.
- TIFF (.tiff)
- Container format, 8/16/32-bit, with no lossy compression. The standard for print and still post-production.
- PNG (.png)
- Lossless compressed format, 8 or 16-bit, with transparency (alpha channel). The web standard for images on a transparent background.
- OpenEXR (.exr)
- Format created by ILM (Industrial Light & Magic) in 2003 to store high-quality images. Channels coded in 16 or 32-bit float (or 32-bit integer), with transparency. Float can hold intensities above 1 (HDR) - the reference format for visual effects.
- Cineon (.cin) / DPX
- The first system, by Kodak, for the digital intermediate. Data stored in logarithmic form (10-bit log), built for scanned film. Ancestor of DPX, still used in film post.
- PSD (.psd)
- Photoshop's native format. Keeps layers, masks and effects. 8, 16 or 32-bit per channel.
- TGA (.tga)
- Truevision Targa format, keeps transparency: 16, 24 or 32 bits per pixel (at 32 bits, 8 bits per channel plus alpha). Used in video games and VFX.
- sRGB
- The standard gamut for screens and the web: about 34% of the CIE 1931 xy diagram. Same primaries as Rec.709, different transfer curve.
- Rec.709
- The HD TV space. Primaries identical to sRGB, different gamma curve. The broadcast video standard.
- DCI-P3
- Digital cinema: about 46% of the xy diagram, with more saturated reds and greens than sRGB. Apple screens and many OLEDs use the same primaries with a D65 white (Display P3).
- Rec.2020
- Extended gamut of UHD (4K, 8K) and HDR: about 64% of the xy diagram. Consumer screens do not yet cover it fully.
- ACES 2065-1 (AP0)
- Academy Color Encoding System, an archival and interchange space. Theoretical primaries beyond the visible so no real colour is lost.
- ACEScg (AP1)
- ACES variant for visual effects and compositing, in linear. Primaries close to the edge of the spectrum: about 66% of the xy diagram, but the whole of Pointer's gamut, that is every real object colour. Handy for 3D rendering.
- Linear
- Encoding where the pixel value is proportional to physical light. Essential for calculations (compositing, 3D rendering). Not suited to direct display.
- Gamma
- A non-linear curve that spreads code values according to perception: more levels in the darks, where the eye tells shades apart best, fewer in the lights. It does not change the image's dynamic range, only how it is encoded.
- Log
- Logarithmic encoding from pro cameras (S-Log, V-Log, LogC, Cineon), made to preserve the sensor's dynamic range (14+ stops) in a 10/12-bit file. Looks flat on recording.
- Scene-referred
- Values proportional to the light in the scene (can exceed 1, HDR). The ACES pipeline up to final rendering.
- Display-referred
- Values limited to what the screen can show (0-1). The final encoding for delivery.
- LUT
- Look-Up Table: a mapping that converts one space into another (Log → Rec.709), or applies a look. 1D for curves, 3D for full transforms.
- D65 / D50
- Reference white points. D65 = 6500 K, daylight (sRGB, Rec.709, Rec.2020). D50 = 5000 K (print and graphic arts).
- Gamut
- The range of hues and saturations a space or medium can reproduce. An 'out of gamut' colour cannot be shown faithfully.
- Dynamic range
- The range of light intensities that can be recorded (from deepest black to brightest white). Measured in stops (EV). Independent of gamut.
- HDR / HDRI
- High Dynamic Range. An image that goes beyond the standard range (0-1), with values 'past screen white'. Allows recovery in post.
- Clipped / crushed (clipping)
- Clipped: highlights exceed the maximum value and are cut to pure white. Crushed: shadows fall below the threshold, to pure black. Recoverable in float, and in RAW within the sensor's saturation limit; not in 8 bits.
- Banding
- Visible bands in a gradient, from too few levels. Typical of 8-bit pushed in the grade. Gone at 16-bit or more.
- EOTF / OETF
- Electro-Optical Transfer Function (screen: signal → light) and its inverse OETF (camera: light → signal). This is gamma, formalised.
- Stops (EV)
- Photographic unit. +1 stop = double the light, −1 stop = halve it. A logarithmic scale of exposure.
- Wide Gamut
- A colour space wider than the standard (sRGB). Rec.2020, ACES and DCI-P3 are wide gamuts to varying degrees.
The iris, a biological aperture
The iris closes in bright light and opens in the dark: the pupil goes from about 2 to 8 mm, sixteen times more light, four stops. With a focal length of about 17 mm, the eye therefore opens from roughly f/2 to f/8; the lens beside it follows the same aperture with its blades. But the iris handles only a small part of our adaptation: most of it happens in the retina, which tunes its sensitivity over seconds to minutes. That is why the world almost always looks “well exposed” to us, while a sensor keeps the same range from one shot to the next.
The eye as a camera
The cornea and the lens act as the objective: they bring light to focus on the retina, where the image forms upside down, and the brain turns it back up. The cornea does about two thirds of the focusing; the flexible lens fine-tunes sharpness with distance (accommodation). At the centre of the retina, the fovea packs the cones: that is where vision is sharpest and most colourful. Where the optic nerve leaves, there are no receptors at all: the blind spot.
The three cones and metamerism
The retina has three types of cones: S (short wavelengths, peak around 440 nm), M (around 545 nm) and L (around 570 nm), from Stockman and Sharpe's measurements. Their sensitivities overlap widely: a yellow 580 nm light strongly excites L and M cones, and barely the S ones. The brain only receives these three signals, and infers colour from them. A direct consequence is metamerism: a well-balanced mix of red and green produces practically the same three signals as a pure yellow, hence the same colour, although the two lights have nothing in common physically. That is how an RGB screen shows yellow without emitting any yellow. At the centre of the fovea there are only cones, and no S cones in the tiny central area; rods, which serve night vision and see no colour, appear around it. The ratio of L to M cones varies a lot from one person to another, without changing the colours we see. The colours of the cones in the diagram are only a code.
The chiasm and the cortex
Both eyes see almost the same scene, and their fields overlap widely in the centre. At the optic chiasm, fibres from the nasal half of each retina cross to the opposite hemisphere; those from the temporal half stay on the same side. Result: everything to the left of the point you look at is processed by the right hemisphere, and vice versa. The fibres relay in the lateral geniculate nucleus, in the thalamus, then the optic radiations carry them to the primary visual cortex (V1), at the back of the skull. Colour is not “seen” by the eye: the brain rebuilds it by comparing the signals of three types of cones.
The fineness of shades
An image stores each channel with a fixed number of levels: 256 in 8 bits, 65,536 in 16 bits; in float (16-bit “half” or 32-bit), decimal numbers are stored, with no visible steps and no ceiling at 1. As long as nothing is touched, 256 levels are enough for the eye. But as soon as grading pushes the image, for instance by lifting the shadows of a dusk sky, the gaps between two levels widen and turn into bands, especially in dark tones and smooth gradients: that is banding. A 16-bit or float image keeps enough shades to be stretched without breaking.
A pixel's channels
A pixel is several stacked channels: red, green, blue, and sometimes a fourth, alpha, which carries no colour but opacity. Each channel is a greyscale image, bright where its colour is strong. A pixel's depth is the sum of its channels: 3 × 8 = 24 bits in 8-bit RGB, 4 × 8 = 32 bits with alpha (the “32-bit” of screens and the web), 3 × 16 = 48 bits in 16-bit, 4 × 32 = 128 bits in float RGBA. In compositing, “32-bit” means instead 32 bits per channel, that is float.
RAW and the Bayer pattern
A sensor does not see colour: each photosite only measures an amount of light. For colour, a red, green or blue filter is placed in front of it, in a checkerboard: the Bayer pattern, with twice as many greens, since the eye is more sensitive to green. The RAW file keeps this mosaic, a single value per photosite, usually on 12 or 14 bits. The three channels of each pixel are then rebuilt from the neighbours: that is demosaicing, done by the camera for a JPEG, or by the development software for a RAW.
- RAW
- Generic name for a digital image file straight from a camera or scanner. Holds the raw sensor data plus the processing parameters, with no irreversible transformation - like undeveloped film, it can be reworked without damage. Larger than a JPEG. Extensions: .cr2 (Canon), .nef (Nikon), .arw (Sony), .dng.
- JPEG (.jpg)
- Compressed 8-bit, lossy format. The standard for the web and consumer photography. Once clipped or overwritten, the information is lost: no recovery possible.
- TIFF (.tiff)
- Container format, 8/16/32-bit, with no lossy compression. The standard for print and still post-production.
- PNG (.png)
- Lossless compressed format, 8 or 16-bit, with transparency (alpha channel). The web standard for images on a transparent background.
- OpenEXR (.exr)
- Format created by ILM (Industrial Light & Magic) in 2003 to store high-quality images. Channels coded in 16 or 32-bit float (or 32-bit integer), with transparency. Float can hold intensities above 1 (HDR) - the reference format for visual effects.
- Cineon (.cin) / DPX
- The first system, by Kodak, for the digital intermediate. Data stored in logarithmic form (10-bit log), built for scanned film. Ancestor of DPX, still used in film post.
- PSD (.psd)
- Photoshop's native format. Keeps layers, masks and effects. 8, 16 or 32-bit per channel.
- TGA (.tga)
- Truevision Targa format, keeps transparency: 16, 24 or 32 bits per pixel (at 32 bits, 8 bits per channel plus alpha). Used in video games and VFX.
- sRGB
- The standard gamut for screens and the web: about 34% of the CIE 1931 xy diagram. Same primaries as Rec.709, different transfer curve.
- Rec.709
- The HD TV space. Primaries identical to sRGB, different gamma curve. The broadcast video standard.
- DCI-P3
- Digital cinema: about 46% of the xy diagram, with more saturated reds and greens than sRGB. Apple screens and many OLEDs use the same primaries with a D65 white (Display P3).
- Rec.2020
- Extended gamut of UHD (4K, 8K) and HDR: about 64% of the xy diagram. Consumer screens do not yet cover it fully.
- ACES 2065-1 (AP0)
- Academy Color Encoding System, an archival and interchange space. Theoretical primaries beyond the visible so no real colour is lost.
- ACEScg (AP1)
- ACES variant for visual effects and compositing, in linear. Primaries close to the edge of the spectrum: about 66% of the xy diagram, but the whole of Pointer's gamut, that is every real object colour. Handy for 3D rendering.
- Linear
- Encoding where the pixel value is proportional to physical light. Essential for calculations (compositing, 3D rendering). Not suited to direct display.
- Gamma
- A non-linear curve that spreads code values according to perception: more levels in the darks, where the eye tells shades apart best, fewer in the lights. It does not change the image's dynamic range, only how it is encoded.
- Log
- Logarithmic encoding from pro cameras (S-Log, V-Log, LogC, Cineon), made to preserve the sensor's dynamic range (14+ stops) in a 10/12-bit file. Looks flat on recording.
- Scene-referred
- Values proportional to the light in the scene (can exceed 1, HDR). The ACES pipeline up to final rendering.
- Display-referred
- Values limited to what the screen can show (0-1). The final encoding for delivery.
- LUT
- Look-Up Table: a mapping that converts one space into another (Log → Rec.709), or applies a look. 1D for curves, 3D for full transforms.
- D65 / D50
- Reference white points. D65 = 6500 K, daylight (sRGB, Rec.709, Rec.2020). D50 = 5000 K (print and graphic arts).
- Gamut
- The range of hues and saturations a space or medium can reproduce. An 'out of gamut' colour cannot be shown faithfully.
- Dynamic range
- The range of light intensities that can be recorded (from deepest black to brightest white). Measured in stops (EV). Independent of gamut.
- HDR / HDRI
- High Dynamic Range. An image that goes beyond the standard range (0-1), with values 'past screen white'. Allows recovery in post.
- Clipped / crushed (clipping)
- Clipped: highlights exceed the maximum value and are cut to pure white. Crushed: shadows fall below the threshold, to pure black. Recoverable in float, and in RAW within the sensor's saturation limit; not in 8 bits.
- Banding
- Visible bands in a gradient, from too few levels. Typical of 8-bit pushed in the grade. Gone at 16-bit or more.
- EOTF / OETF
- Electro-Optical Transfer Function (screen: signal → light) and its inverse OETF (camera: light → signal). This is gamma, formalised.
- Stops (EV)
- Photographic unit. +1 stop = double the light, −1 stop = halve it. A logarithmic scale of exposure.
- Wide Gamut
- A colour space wider than the standard (sRGB). Rec.2020, ACES and DCI-P3 are wide gamuts to varying degrees.
Sources: cone fundamentals by Stockman & Sharpe (2000), CVRL; CIE 1931 chromaticity table; Pointer's gamut data from colour-science (BSD-3-Clause), after M. R. Pointer (1980); offset targets ISO 12647-2 (coated paper). 3D character: “Sophia Animated 003” by Renderpeople, CC BY 4.0. Photos: Xavier Reyé.
Ten questions on the eye, gamuts, dynamic range, printing and bits.
