Base Colour
Lightness Slice L*  65
Cross-section through CIELAB a*b* plane at fixed L*.
Colour Spaces
Rendering Intent
Compression Strength  0.90
Controls chroma compression amount for perceptual intent.
Sampling
Resolution  120×120
Overlays
ΔE Playground
A:
B:
Gamut Mapping Results
Source Slice
H–C disk at fixed L* in source gamut. Click to probe.
Mapped to Target
Colours mapped into target gamut via selected intent.
Probe Point
Click on a slice canvas to probe a point.
Before / After (12 Test Colours)
Actions
Export
Share URL
Gamut Area Comparison (CIE xy)

Compare chromaticity triangle area coverage of all 5 colour spaces against the CIE spectral locus.

Gamut Volume Comparison (CIELAB Monte Carlo)

Estimate gamut volume in CIELAB using 5 000 random samples per space. Results vary slightly each run.

Batch Gamut Mapping

Paste HEX values (one per line, max 50) to map from source to target via the selected intent.

Gamut Mapping Standards
IEC 61966-2-1:1999 — sRGB

Defines the sRGB colour space for consumer displays and web content. Primaries: R(0.64, 0.33), G(0.30, 0.60), B(0.15, 0.06) with D65 white point. The transfer function uses a piecewise curve with a linear segment below 0.0031308 and a gamma ≈2.2 curve above. Gamut covers approximately 35.9% of the CIE 1931 spectral locus area.

SMPTE ST 432-1:2019 — Display P3

Display P3 extends the sRGB gamut (especially in red-yellow and green) with primaries at R(0.680, 0.320), G(0.265, 0.690), B(0.150, 0.060) and D65 white point. Originally specified for digital cinema (DCI-P3), the "Display P3" variant uses the sRGB transfer function. Covers approximately 45.5% of the spectral locus. Widely adopted in Apple devices, HDR web content, and CSS Color Level 4.

ITU-R BT.2020-2 — Rec. 2020

Ultra-high-definition television colour primaries at R(0.708, 0.292), G(0.170, 0.797), B(0.131, 0.046) with D65 white point. Located on the spectral locus at approximately 630 nm (R), 532 nm (G), and 467 nm (B), requiring monochromatic primaries. Covers approximately 75.8% of the spectral locus. No current display fully reproduces this gamut; it serves as a container for HDR/WCG content.

Adobe RGB (1998)

Developed by Adobe Systems for professional photography and print. Primaries: R(0.64, 0.33), G(0.21, 0.71), B(0.15, 0.06) with D65 white. The green primary is pushed further toward the spectral locus than sRGB, covering approximately 52.1% of the spectral locus — a significant improvement for CMYK conversion workflows. Uses a simple gamma of 2.19921875 (= 563/256).

ProPhoto RGB (ROMM RGB)

ProPhoto RGB (Reference Output Medium Metric) uses extremely wide primaries at R(0.7347, 0.2653), G(0.1596, 0.8404), B(0.0366, 0.0001) with D50 white point. It encompasses approximately 90% of the spectral locus and includes imaginary (non-physical) chromaticities. Preferred working space for raw photo editing (Lightroom, Camera Raw) to avoid premature gamut clipping. Requires careful handling of out-of-gamut colours when converting to narrower spaces.

ICC.1:2022 — Rendering Intents

The ICC specification defines four rendering intents:

  • Perceptual: Maps entire source gamut into target, compressing relationships between colours. Preserves hue and lightness hierarchy but changes chroma.
  • Relative Colorimetric: Clips out-of-gamut colours to the nearest in-gamut point. Preserves in-gamut colours exactly; adapts white point.
  • Saturation: Prioritises vividness over accuracy. May shift hues and lightness to maintain maximum saturation.
  • Absolute Colorimetric: Like relative, but does not adapt the white point. Used for proofing simulations.
ISO 11664-6:2014 — CIEDE2000

Defines the CIEDE2000 colour-difference formula (ΔE00), the state-of-the-art metric for quantifying perceptual colour difference. Incorporates lightness, chroma, and hue weighting plus a rotation term for the blue region. Used in this lab to assess mapping quality: a lower ΔE00 indicates less perceptual change from the original colour after gamut mapping.

CIE 15:2018 — Colorimetry (4th Ed.)

The foundational CIE colorimetry report defining standard observers (2° / 10°), illuminants (A, D50, D65, etc.), CIELAB/CIELUV colour spaces, and colour-difference formulae. The gamut boundary slicing in this lab uses CIELAB L*a*b* coordinates as defined in CIE 15:2018.

Formulas & Mathematics
Hard Clip (Relative Colorimetric)
R′ = clamp(Rlinear, 0, 1)
G′ = clamp(Glinear, 0, 1)
B′ = clamp(Blinear, 0, 1)

Each linear RGB channel in the target space is independently clamped to [0, 1]. Fast but causes hue shifts in highly saturated out-of-gamut colours because the three channels are clipped independently.

Perceptual Chroma Compression
Lab → LCh
Binary search: find max C ∈ [0, Coriginal] such that Lab(L, C, h) ∈ target gamut
Csafe = bisect result (24 iterations, precision < 0.01)
Map: Lab(L, Csafe, h) → XYZ → target linear RGB

Preserves lightness L* and hue h exactly, compressing only chroma C* toward the achromatic axis until the colour falls within the target gamut. This maintains colour relationships and avoids hue shifts at the cost of reduced vividness.

Saturation Uniform Scaling
lin = XYZ → target linear RGB
maxVal = max(lin[R], lin[G], lin[B], 1)
Scaled = lin / maxVal
Clamp to [0, 1]

Scales all three channels uniformly by the factor needed to bring the brightest channel to 1.0. Prioritises vivid colours over accuracy — may shift lightness and hue.

Absolute Colorimetric (Bradford CAT + Clip)
XYZadapted = MBradford−1 · diag(LMSdst/LMSsrc) · MBradford · XYZsrc
lin = XYZadapted → target fromXYZ
Clamp to [0, 1]

Adapts the white point from source to target using the Bradford chromatic adaptation transform, then clips any remaining out-of-gamut values. Used for proofing simulations where the paper/media white matters.

Gamut Boundary Bisection
For each hue angle h ∈ [0°, 360°):
  Binary search C ∈ [0, 180] (24 iterations)
  Test: Lab(L, C·cos(h), C·sin(h)) → XYZ → target linear RGB ∈ [0,1]?
  Result = max C that passes → boundary point (a*, b*)

Traces the gamut boundary in the a*b* plane at a fixed L* using radial bisection for each hue angle. 360 hue steps with 24 bisection iterations yields sub-0.01 chroma precision.

RGB ↔ XYZ Matrix Derivation
Given primaries R(xr,yr), G(xg,yg), B(xb,yb) and white W(xw,yw):

Compute primary XYZs: Xr = xr/yr, Yr=1, Zr=(1−xr−yr)/yr
Build M = [primary XYZ columns], invert M
S = M−1 · XYZwhite
toXYZ = [Sr·colr, Sg·colg, Sb·colb]
fromXYZ = toXYZ−1

This lab computes exact matrices for all 5 spaces from their CIE primary coordinates.

ΔE Colour Difference Formulas
ΔE*ab (CIE76):
ΔE = √[(ΔL*)² + (Δa*)² + (Δb*)²]

ΔE*94:
SL=1, SC=1+0.045C*₁, SH=1+0.015C*₁

ΔE00 (CIEDE2000):
Includes L′, C′, H′ corrections, SL, SC, SH weighting, and rotation term RT for blue region.
Halton & Stratified Samplers
Halton(n, base):
Radical inverse of n in given base:
f = 1, r = 0; while (n > 0) { f /= base; r += f · (n mod base); n = ⌊n/base⌋ }

Stratified:
Subdivide [0,1]² into k×k cells, place one jittered sample per cell.

Low-discrepancy sampling reduces aliasing at gamut boundaries compared to uniform grid sampling. Halton sequences using coprime bases (2, 3) provide smooth coverage of the 2D a*b* plane. Stratified sampling guarantees at least one sample per cell.

References & Citations

Gamut Mapping Algorithms

Morovic, J. & Luo, M. R. (2001). "The Fundamentals of Gamut Mapping: A Survey." J. Imaging Science & Technology 45(3):283–290.

Zolliker, P. & Simon, K. (2007). "Retaining Local Image Information in Gamut Mapping Algorithms." IEEE Trans. Image Processing 16(3):664–672.

Bala, R. (2003). "Device Characterization." In Digital Color Imaging Handbook, Chapter 5. CRC Press.

Green, P. & MacDonald, L. (Eds.) (2002). Colour Engineering: Achieving Device Independent Colour. Wiley.

Colour Spaces & Standards

IEC 61966-2-1:1999. Default RGB colour space — sRGB.

SMPTE ST 432-1:2019. Digital Cinema Display P3.

ITU-R BT.2020-2 (2015). Rec. 2020 parameter values for UHDTV.

Adobe Systems (1998). "Adobe RGB (1998) Color Image Encoding." Version 2005-05.

Spaulding, K. E., Woolfe, G. J. & Giorgianni, E. J. (2000). "Reference Input/Output Medium Metric RGB Color Encodings (RIMM/ROMM RGB)." Proc. IS&T PICS Conf. ProPhoto RGB specification.

ICC.1:2022-05. Image technology colour management — Architecture, profile format, and data structure. Rendering intent definitions.

Colour Difference & Colorimetry

Sharma, G., Wu, W. & Dalal, E. N. (2005). "The CIEDE2000 Color-Difference Formula." Color Res. Appl. 30(1):21–30.

CIE 15:2018. Colorimetry, 4th Edition.

Wyszecki, G. & Stiles, W. S. (2000). Color Science: Concepts and Methods. Wiley.

Sampling & Numerical Methods

Halton, J. H. (1960). "On the Efficiency of Certain Quasi-Random Sequences of Points in Evaluating Multi-Dimensional Integrals." Numerische Mathematik 2(1):84–90.

Shirley, P. (1991). "Discrepancy as a Quality Measure for Sample Distributions." Proc. Eurographics '91.

Pharr, M., Jakob, W. & Humphreys, G. (2016). Physically Based Rendering: From Theory to Implementation, 3rd Edition. Elsevier.

About This Tool

The Gamut Mapping Lab is an interactive visualisation built with vanilla JavaScript and HTML5 Canvas. All colour conversions, gamut boundary tracing, and ΔE calculations are performed client-side using industry-standard matrix mathematics derived from CIE and ICC specifications.

Research & Visualization
Rendering Intent Comparison

Switch between the four intents in the Lab tab to compare their effects on the same out-of-gamut colour set. Key observations:

  • Perceptual: Preserves hue and lightness; compresses chroma. Best for photographic content where relationships between colours matter more than absolute accuracy.
  • Relative Colorimetric: Preserves in-gamut colours exactly but creates hard edges at the gamut boundary. Best for spot colours and logos.
  • Saturation: Maximises vividness at the expense of accuracy. Useful for infographics and business presentations.
  • Absolute Colorimetric: Simulates source media on target device including white point. Critical for softproofing.
Gamut Boundary Shape Analysis

Vary L* across the full range (5–95) to observe how gamut boundaries change shape:

  • Low L* (5–20): All gamuts are small and similar. Deep shadows have very limited chroma regardless of the space.
  • Mid L* (40–60): Maximum gamut differences. sRGB's blue-cyan weakness is most visible. ProPhoto engulfs all others.
  • High L* (80–95): Gamuts narrow toward the achromatic point. The yellow-green region retains the most chroma at high lightness.

Asymmetric boundary shapes explain why gamut mapping algorithms that operate in LCh space perform better than those clipping in RGB.

Area vs Volume: What Gamut Coverage Really Means

The common "% of spectral locus" metric measures 2D chromaticity triangle area in CIE 1931 (x, y), but this is a poor proxy for actual perceptual gamut size:

  • The CIE xy diagram is perceptually non-uniform (MacAdam ellipses vary 20:1).
  • 2D area ignores the lightness dimension entirely.
  • CIELAB volume (measured by Monte Carlo sampling) is a more meaningful metric.

Use the Actions tab to compare both area and volume for all 5 spaces. Note how ProPhoto's xy area advantage over Rec.2020 is larger than its volume advantage.

Practical Gamut Mapping Workflow
  1. Capture: Work in the widest gamut available (ProPhoto, Rec.2020, or at minimum P3) to preserve all original colour information.
  2. Edit: Use 16-bit or 32-bit float per channel to avoid banding from quantisation in wide gamuts.
  3. Soft-proof: Use absolute colorimetric intent to simulate the target medium on your editing display.
  4. Convert: Apply perceptual intent for photographs, relative colorimetric for logos and spot colours.
  5. Validate: Batch-map your palette through this lab and check ΔE00 values. Aim for avg < 2 in critical work.