diff --git a/chapters/human-06-color-metrics.qmd b/chapters/human-06-color-metrics.qmd index 4628df20..d967e597 100644 --- a/chapters/human-06-color-metrics.qmd +++ b/chapters/human-06-color-metrics.qmd @@ -170,38 +170,142 @@ The u′, v′ normalization plane and spectrum locus in XYZ space, shown with e @fig-uv-blackbody-geometry provides a sense of the color appearance at different locations in the $(u',v')$ plane, along with the position of the blackbody locus. -![Schematic color appearance and Planckian locus in the CIE 1976 $(u', v')$ UCS diagram (source: [Wikimedia Commons](https://commons.wikimedia.org/w/index.php?curid=3770098), public domain).](images/human/06-color-metrics/chromaticity/CIE_1976_UCS-wikipedia-blackbody.png){#fig-uv-blackbody-geometry width="70%"} +![Schematic color appearance and Planckian locus in the CIE 1976 $(u', v')$ UCS diagram (source: [Wikimedia Commons](https://commons.wikimedia.org/w/index.php?curid=3770098), public domain).](images/human/06-color-metrics/chromaticity/CIE_1976_UCS-wikipedia-blackbody.png){#fig-uv-blackbody-geometry width="50%"} Because this mapping is still a central projection onto a plane, additive mixtures of lights continue to lie on straight line segments, and display gamuts remain triangles. Both chromaticity representations discard luminance, which is an important feature of the light. When describing a light, it is common to inform users about luminance by including the $Y$ value. Thus, you will often see people describing a light with three values, $Yxy$ or $Yu'v'$. It is straightforward to convert those three values to recover the $(X,Y,Z)$ values. ## CIELAB {#sec-cielab} +There are two shortcomings we would like to address concerning the chromaticity representations. -The $(u', v')$ improves the uniformity of two-dimensional chromaticity spacing, but it is far from perfect. To quantify the full perceptual difference between two colors that may differ in both luminance and chromaticity, we need a three-dimensional space that incorporates adaptation to the scene white point and the nonlinear brightness sensitivity of human vision. +First, the $(u', v')$ improves the uniformity of two-dimensional chromaticity spacing, but it remains a two-dimensional measure of a three-dimensional signal. To quantify the full perceptual difference between two lights - which will generally differ in both luminance and chromaticity - we need to expand the metric to include all three dimensions. +Second, the human visual adjusts its properties substantially as it changes between contexts, say from inside a room to outside in the sun. These adjustments - often called light- and dark-adaptation - substantially change visual sensitivity and thus have a big impact on how well we can discriminate between different lights. +In 1976 the CIE completed work on the color metrics that address these two issues. The metrics account for all three dimensions, and they include parameters about the ambient viewing conditions which determine the likely state of adaptation. -We really want a three-dimensional equaliztion, not just in the chromaticity plane. +The CIE committee members could not come to an agreement on a single metric, and they approved two standard discrimination metrics: CIELUV and CIELAB. The CIELUV metric is an extension of the $(u',v')$ system, and it was favored by key individuals (Günther Wyszecki) who wanted the new system to preserve a projective chromaticity diagram while accounting for the ambient white point $(X_n, Y_n, Z_n)$: -Adams-Nickerson data. +$$ +\begin{aligned} +L^* &= \begin{cases} +116 \left(\frac{Y}{Y_n}\right)^{1/3} - 16, & \frac{Y}{Y_n} > \left(\frac{6}{29}\right)^3 \approx 0.008856, \\[6pt] +\left(\frac{29}{3}\right)^3 \frac{Y}{Y_n} \approx 903.3\,\frac{Y}{Y_n}, & \frac{Y}{Y_n} \le \left(\frac{6}{29}\right)^3, +\end{cases} \\[8pt] +u^* &= 13\, L^* (u' - u'_n), \\[4pt] +v^* &= 13\, L^* (v' - v'_n), +\end{aligned} +$$ {#eq-cieluv} + +where $(u'_n, v'_n)$ are the $(u', v')$ chromaticity coordinates of the reference white point from @eq-uv-chromaticity, and the perceptual color difference between two lights is the Euclidean distance $\Delta E^*_{uv} = \sqrt{(\Delta L^*)^2 + (\Delta u^*)^2 + (\Delta v^*)^2}$. + +The ambient white point values are the $u'_n,v'_n$ chromaticity coordinates and $Y_n$ value of a white reflective surface under the ambient illumination conditions. These values provide information about the viewer's likely state of adaptation, and the CIELUV values $(L^*,u^*,v^*)$ are all specified in terms of the white point values. + +Another group—including **R. W. G. (Bob) Hunt** and researchers in the surface-color and textile industries—favored the **CIELAB** formula, which simplified the earlier **Adams–Nickerson** opponent-color space developed by Elliot Q. Adams and Dorothy Nickerson. Rather than preserving a projective chromaticity diagram, CIELAB normalizes each tristimulus value $(X, Y, Z)$ directly by the ambient white point $(X_n, Y_n, Z_n)$ and applies a compressive nonlinearity before taking opponent differences: + +$$ +\begin{aligned} +L^* &= 116\, f\!\left(\frac{Y}{Y_n}\right) - 16, \\[6pt] +a^* &= 500 \left[ f\!\left(\frac{X}{X_n}\right) - f\!\left(\frac{Y}{Y_n}\right) \right], \\[6pt] +b^* &= 200 \left[ f\!\left(\frac{Y}{Y_n}\right) - f\!\left(\frac{Z}{Z_n}\right) \right], +\end{aligned} +$$ {#eq-cielab} + +where the piecewise compressive function $f(t)$ is + +$$ +f(t) = \begin{cases} +t^{1/3}, & t > \left(\frac{6}{29}\right)^3 \approx 0.008856, \\[6pt] +\frac{1}{3}\left(\frac{29}{6}\right)^2 t + \frac{4}{29} \approx 7.787\,t + \frac{16}{116}, & t \le \left(\frac{6}{29}\right)^3 . +\end{cases} +$$ {#eq-cielab-f} -CIELUV/CIELAB +Notice that $L^*$ in @eq-cielab is identical to $L^*$ in @eq-cieluv. -Wyszecki wanted to preserve the projection mapping. +### Color appearance - +![Color appearance in CIELAB coordinates.](images/human/06-color-metrics/cielab/071-cielab-color-solid.png){#fig-pattern-color} + +Comment on red-green and blue-yellow axes. Reference opponency in FOV, perhaps. Maybe we get some opponency in this book, too. Could happen in the wavelength encoding chapter. + +Let's get Munsell in here, too. Something about Hurvich and Jameson. + +![Munsell images](images/human/06-color-metrics/appearance/074-munsell-book-of-colors.png){#fig-munsell-appearanc-overview} + +![Munsell images](images/human/06-color-metrics/appearance/075-munsell-color-solid-model.png){#fig-munsell-appearanc-overview} + +![Munsell images](images/human/06-color-metrics/appearance/076-munsell-value-radial-slices.png){#fig-munsell-appearanc-overview} + + +::: {.callout-note title="Munsell notation and renotation" collapse="true"} + +Explain the notation and the OSA renotation. + +::: + +### Color difference metric: $\Delta E$ + +A key point for both of these representations is to make the perceptual difference between two lights match the Euclidean distance between their representation. We use the symbol $\Delta E$ to denote the Euclidean difference, and we add a subscript to undicate whether we are measuring in CIELUV or CIELAB space, such as +$$ +\Delta E^*_{ab} = \sqrt{(\Delta L^*)^2 + (\Delta a^*)^2 + (\Delta b^*)^2} +$${#eq-delta-E-ab} + +The two representations are not the same, but they are not wildly different either. We can judge the similarity by plotting the equal-difference contours (a circle) in one space (CIELAB) in the other space (CIELUV). We can also transform a grid from CIELAB space into CIELUV space. The interactive plots in @fig-cieluv-vs-cielab provide a sense of how these two representations differ. + +::: {#fig-cieluv-vs-cielab} + +::: {.content-visible when-format="html"} +{{< include includes/figures/cieluv-vs-cielab.qmd >}} +::: + +::: {.content-visible unless-format="html"} +![](images/human/06-color-metrics/cieluv-vs-cielab-static.png){fig-alt="Side-by-side comparison of CIELAB (a*, b*) and CIELUV (u*, v*) at L* = 65, showing a constant Delta E*ab = 15 circle around a red-orange test light mapped into a warped contour in (u*, v*) alongside a dashed Delta E*uv = 15 reference circle." width="90%"} +::: + +Comparison of CIELAB $(a^*, b^*)$ and CIELUV $(u^*, v^*)$ at constant lightness $L^*$ under a D65 white point. A regular grid and a circle of constant $\Delta E^*_{ab} = 15$ (solid) in $(a^*, b^*)$ warp nonlinearly in $(u^*, v^*)$, where the dashed circle marks $\Delta E^*_{uv} = 15$. Use the controls in the HTML version to vary $L^*$ and the test light. +::: + +Over time, the CIELAB representation has been more widely used than CIELUV, and it has been extended and amended in various ways. CIELUV remains useful primarily in display and lighting engineering because it preserves the projective $(u', v')$ chromaticity diagram, while CIELAB and CIEDE2000 dominate perceptual color-difference evaluation. + +::: {.callout-note title="The rise of CIELAB" collapse="true"} + +Two lines of evidence show how CIELAB became the dominant CIE color-difference standard over CIELUV: + +**Scholarly usage:** A search of the [OpenAlex](https://openalex.org/) scholarly literature database (November 2026) illustrates the gap in adoption across imaging, printing, textiles, and vision science: + +| Term | Matching Works | +|---|---:| +| `"CIELAB"` | 46,499 | +| `"CIELUV"` | 1,893 | +| `"CIEDE2000"` | 5,513 | +| `"CIE94"` | 605 | + +`"CIELAB"` appears roughly **25×** more often than `"CIELUV"`, and `"CIEDE2000"` alone appears nearly **3×** more often than `"CIELUV"`. + +::: + +These later CIE standards leave the $(L^*, a^*, b^*)$ coordinate representation itself intact and change only **how color differences ($\Delta E$) are computed**. + +One modification to CIELAB, made in **CIE94** Added chroma- and hue-dependent weighting functions to correct CIELAB's overestimation of perceptual differences at high chroma ($\Delta E^*_{94}$, CIE 116-1995). Rather than measuring simple Euclidean distance in $(L^*, a^*, b^*)$, they convert differences into cylindrical lightness, chroma, and hue coordinates $(L^*, C^*_{ab}, h_{ab})$ and apply a weighted, position-dependent quadratic distance (so $\Delta E$ is no longer a global Euclidean metric in a transformed 3D space): + +The next modificiation, made in **CIEDE2000** Added lightness, chroma, and hue weighting functions ($S_L, S_C, S_H$), a chroma–hue interaction rotation term ($R_T$) in the blue region, and a rescaling of $a^*$ near neutral grays ($\Delta E_{00}$, CIE 142-2001; ISO/CIE 11664-6). ## Spatial-CIELAB (S-CIELAB) {#sec-scielab} Color appearance also depends on spatial pattern. Just think back to chromatic aberration - how could it not? - +![Spatial CIELAB architecture](images/human/06-color-metrics/s-cielab/113-three-channel-spatial-color-model.png){#fig-scielab-model} + +More + +![Spatial CIELAB architecture](images/human/06-color-metrics/s-cielab/115-spatial-cielab-processing-pipeline.png){#fig-scielab-processing} diff --git a/chapters/images/human/06-color-metrics/appearance/073-munsell-color-appearance-overview.png b/chapters/images/human/06-color-metrics/appearance/073-munsell-color-appearance-overview.png deleted file mode 100644 index 6a839003..00000000 Binary files a/chapters/images/human/06-color-metrics/appearance/073-munsell-color-appearance-overview.png and /dev/null differ diff --git a/chapters/images/human/06-color-metrics/cieluv-vs-cielab-static.png b/chapters/images/human/06-color-metrics/cieluv-vs-cielab-static.png new file mode 100644 index 00000000..65a23604 Binary files /dev/null and b/chapters/images/human/06-color-metrics/cieluv-vs-cielab-static.png differ diff --git a/chapters/images/human/06-color-metrics/cieluv-vs-cielab-static.svg b/chapters/images/human/06-color-metrics/cieluv-vs-cielab-static.svg new file mode 100644 index 00000000..9ce8d362 --- /dev/null +++ b/chapters/images/human/06-color-metrics/cieluv-vs-cielab-static.svg @@ -0,0 +1,39 @@ + +CIELAB (a*, b*) at L* = 65 +CIELUV (u*, v*) at L* = 65 + + + +a* (red–green) +b* (yellow–blue) + + + +u* +v* + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/chapters/includes/figures/cieluv-vs-cielab.qmd b/chapters/includes/figures/cieluv-vs-cielab.qmd new file mode 100644 index 00000000..bd012820 --- /dev/null +++ b/chapters/includes/figures/cieluv-vs-cielab.qmd @@ -0,0 +1,242 @@ +::: {style="width: 100%; margin: 0 auto; overflow: visible; font-size: 0.95rem;"} + +```{ojs} +//| echo: false +viewof luv_lab_Lstar = Inputs.range([30, 85], { + value: 65, + step: 5, + label: "Lightness L*" +}) + +viewof luv_lab_preset = Inputs.select( + [ + { name: "Neutral (D65 white)", a: 0, b: 0 }, + { name: "Red-orange", a: 45, b: 35 }, + { name: "Yellow-green", a: -20, b: 50 }, + { name: "Green", a: -45, b: 25 }, + { name: "Cyan", a: -30, b: -20 }, + { name: "Blue", a: 15, b: -50 }, + { name: "Magenta", a: 45, b: -30 } + ], + { + label: "Test light", + format: d => d.name, + value: { name: "Red-orange", a: 45, b: 35 } + } +) +``` + +```{ojs} +//| echo: false +luv_lab_calc = { + const Xn = 95.047, Yn = 100.0, Zn = 108.883; + const denom_n = Xn + 15 * Yn + 3 * Zn; + const un = (4 * Xn) / denom_n; + const vn = (9 * Yn) / denom_n; + const delta = 6 / 29; + + function finv(t) { + return t > delta ? t * t * t : 3 * delta * delta * (t - 4 / 29); + } + + function lab2xyz(L, a, b) { + const fy = (L + 16) / 116; + const fx = a / 500 + fy; + const fz = fy - b / 200; + return [ + Math.max(0, Xn * finv(fx)), + Math.max(0, Yn * finv(fy)), + Math.max(0, Zn * finv(fz)) + ]; + } + + function xyz2uv(X, Y, Z) { + const d = X + 15 * Y + 3 * Z; + if (d <= 0) return [0, 0]; + return [(4 * X) / d, (9 * Y) / d]; + } + + function lab2luv(L, a, b) { + const [X, Y, Z] = lab2xyz(L, a, b); + const [up, vp] = xyz2uv(X, Y, Z); + return [13 * L * (up - un), 13 * L * (vp - vn)]; + } + + // Approximate display color for a (L, a, b) point (for visual cue only) + function lab2css(L, a, b) { + const [X, Y, Z] = lab2xyz(L, a, b); + const x = X / 100, y = Y / 100, z = Z / 100; + let r = 3.2406 * x - 1.5372 * y - 0.4986 * z; + let g = -0.9689 * x + 1.8758 * y + 0.0415 * z; + let bl = 0.0557 * x - 0.2040 * y + 1.0570 * z; + const compand = c => { + const clamped = Math.max(0, Math.min(1, c)); + return clamped <= 0.0031308 ? 12.92 * clamped : 1.055 * Math.pow(clamped, 1 / 2.4) - 0.055; + }; + return `rgb(${Math.round(compand(r)*255)}, ${Math.round(compand(g)*255)}, ${Math.round(compand(bl)*255)})`; + } + + const L = luv_lab_Lstar; + const radius = 15; + const a0 = luv_lab_preset.a; + const b0 = luv_lab_preset.b; + const [u0, v0] = lab2luv(L, a0, b0); + + const circlePts = []; + const refUvPts = []; + let minDEuv = Infinity; + let maxDEuv = 0; + + const N = 72; + for (let i = 0; i <= N; i++) { + const theta = (2 * Math.PI * i) / N; + const a = a0 + radius * Math.cos(theta); + const b = b0 + radius * Math.sin(theta); + const [u, v] = lab2luv(L, a, b); + const dEuv = Math.hypot(u - u0, v - v0); + if (i < N) { + if (dEuv < minDEuv) minDEuv = dEuv; + if (dEuv > maxDEuv) maxDEuv = dEuv; + } + circlePts.push({ i, a, b, u, v, dEuv, color: lab2css(L, a, b) }); + refUvPts.push({ + i, + u: u0 + radius * Math.cos(theta), + v: v0 + radius * Math.sin(theta) + }); + } + + // Constant-a* and constant-b* grid lines to show nonlinear warp + const gridLines = []; + const vals = [-60, -30, 0, 30, 60]; + for (const av of vals) { + for (let bv = -60; bv <= 60; bv += 5) { + const [u, v] = lab2luv(L, av, bv); + gridLines.push({ series: `a=${av}`, a: av, b: bv, u, v }); + } + } + for (const bv of vals) { + for (let av = -60; av <= 60; av += 5) { + const [u, v] = lab2luv(L, av, bv); + gridLines.push({ series: `b=${bv}`, a: av, b: bv, u, v }); + } + } + + return { + L, + radius, + a0, + b0, + u0, + v0, + centerColor: lab2css(L, a0, b0), + circlePts, + refUvPts, + gridLines, + minDEuv, + maxDEuv + }; +} +``` + +```{ojs} +//| echo: false +html`
+
+ ${Plot.plot({ + title: `CIELAB (a*, b*) at L* = ${luv_lab_calc.L}`, + width: 360, + height: 360, + aspectRatio: 1, + marginLeft: 48, + marginBottom: 42, + x: { label: "a* (red–green)", domain: [-90, 90] }, + y: { label: "b* (yellow–blue)", domain: [-90, 90] }, + marks: [ + Plot.gridX({ strokeOpacity: 0.15 }), + Plot.gridY({ strokeOpacity: 0.15 }), + Plot.ruleX([0], { stroke: "#999", strokeDasharray: "3,3" }), + Plot.ruleY([0], { stroke: "#999", strokeDasharray: "3,3" }), + Plot.line(luv_lab_calc.gridLines, { + x: "a", + y: "b", + z: "series", + stroke: "#cfd8dc", + strokeWidth: 1 + }), + Plot.line(luv_lab_calc.circlePts, { + x: "a", + y: "b", + stroke: "#1f2937", + strokeWidth: 2.2 + }), + Plot.dot([{ a: luv_lab_calc.a0, b: luv_lab_calc.b0, c: luv_lab_calc.centerColor }], { + x: "a", + y: "b", + r: 6, + fill: "c", + stroke: "#111", + strokeWidth: 1.5 + }) + ] + })} +
+
+ ${Plot.plot({ + title: `CIELUV (u*, v*) at L* = ${luv_lab_calc.L}`, + width: 360, + height: 360, + aspectRatio: 1, + marginLeft: 48, + marginBottom: 42, + x: { label: "u*", domain: [-110, 110] }, + y: { label: "v*", domain: [-110, 110] }, + marks: [ + Plot.gridX({ strokeOpacity: 0.15 }), + Plot.gridY({ strokeOpacity: 0.15 }), + Plot.ruleX([0], { stroke: "#999", strokeDasharray: "3,3" }), + Plot.ruleY([0], { stroke: "#999", strokeDasharray: "3,3" }), + Plot.line(luv_lab_calc.gridLines, { + x: "u", + y: "v", + z: "series", + stroke: "#cfd8dc", + strokeWidth: 1 + }), + Plot.line(luv_lab_calc.refUvPts, { + x: "u", + y: "v", + stroke: "#64748b", + strokeDasharray: "4,4", + strokeWidth: 1.5 + }), + Plot.line(luv_lab_calc.circlePts, { + x: "u", + y: "v", + stroke: "#b91c1c", + strokeWidth: 2.2 + }), + Plot.dot([{ u: luv_lab_calc.u0, v: luv_lab_calc.v0, c: luv_lab_calc.centerColor }], { + x: "u", + y: "v", + r: 6, + fill: "c", + stroke: "#111", + strokeWidth: 1.5 + }) + ] + })} +
+
+

+ Selected test light (${luv_lab_preset.name}): + (a*, b*) = (${luv_lab_calc.a0.toFixed(0)}, ${luv_lab_calc.b0.toFixed(0)}) + → (u*, v*) = (${luv_lab_calc.u0.toFixed(1)}, ${luv_lab_calc.v0.toFixed(1)}). + Around the constant ΔE*ab = 15 circle (solid), ΔE*uv ranges from + ${luv_lab_calc.minDEuv.toFixed(1)} to ${luv_lab_calc.maxDEuv.toFixed(1)} + (dashed circle shows ΔE*uv = 15). +

` +``` + +::: +