Skip to content

Color Reproduction and Color Spaces

Prerequisites

Signal Chain -> this page -> Color Accuracy Analyzer

Color spaces matter in image sensor work because a sensor does not measure "red", "green", and "blue" in the same way the eye or an sRGB display defines them. A CIS pixel measures three device-dependent spectral integrals. Color reproduction is the process of turning those integrals into a standard colorimetric space, usually CIE XYZ, then into a display or evaluation space such as sRGB or CIE Lab.

For COMPASS, this page is the bridge between optical simulation and image-quality metrics:

  1. Electromagnetic or browser models produce channel spectral response.
  2. Scene spectra and illuminants are integrated through that response.
  3. White balance and a color correction matrix map camera RGB to XYZ.
  4. Lab and color-difference metrics quantify the remaining error.

Sensor Color Is Spectral Matching

For channel c{R,G,B}, a compact sensor response model is:

Qc(λ)=Tlens(λ)TIR(λ)TCF,c(λ)ηabs,c(λ)ηcol,c(λ)

where:

  • Qc(λ) is the end-to-end spectral response of channel c.
  • Tlens(λ) is camera lens transmittance.
  • TIR(λ) is the IR-cut filter transmittance.
  • TCF,c(λ) is the color filter transmittance.
  • ηabs,c(λ) is optical absorption in the target photodiode region.
  • ηcol,c(λ) is the carrier collection efficiency after absorption.

For a surface patch j under illuminant E(λ) with reflectance ρj(λ), the raw channel response is:

rc,j=λ1λ2E(λ)ρj(λ)Qc(λ)dλ

This equation is the core reason color is a sensor-design topic. CFA thickness, dye spectrum, microlens focus, DTI leakage, IR-cut slope, and silicon absorption depth all change Qc(λ), and therefore change the camera RGB triplet before any ISP correction is applied.

Camera RGB is not display RGB

Raw camera RGB is a device-dependent coordinate system. Its axes are the sensor channel responses, not the CIE standard observer primaries and not the sRGB display primaries. Treating raw RGB as sRGB hides illuminant dependence, metameric error, and CFA trade-offs.

CIE XYZ Reference Color

CIE XYZ is the usual device-independent reference for color reproduction. Given the same illuminant and surface reflectance, the reference tristimulus vector is:

[XjYjZj]=kλ1λ2E(λ)ρj(λ)[x¯(λ)y¯(λ)z¯(λ)]dλ

where:

  • x¯(λ), y¯(λ), and z¯(λ) are the CIE standard observer color matching functions.
  • k is a normalization constant, often chosen so the reference white has Y=100 or Y=1.
  • Y corresponds to photopic luminance in the CIE system.

Chromaticity removes absolute luminance:

x=XX+Y+Z,y=YX+Y+Z

The CIE 1931 chromaticity diagram used by the color-filter simulator plots these (x,y) coordinates. It is useful for visualizing gamut, but it does not by itself guarantee low color error because luminance and nonlinear perceptual uniformity are not represented well in the 2D diagram.

White Balance

White balance removes the first-order illuminant cast by forcing a neutral target to become neutral after channel scaling. If a neutral patch has raw response rw=[rR,rG,rB]T, a common green-referenced gain set is:

gR=rGrR,gG=1,gB=rGrB

The balanced camera vector is:

cj=[gR000gG000gB](rjb)

where b is the black-level or dark offset. In a simulated sensor, b may be zero. In real calibration data it must be removed before color correction.

White balance alone cannot make the sensor match the human observer. It equalizes one white point, but it does not fix spectral mismatch across colored objects. That residual mismatch is handled by a color correction matrix.

Color Correction Matrix

A 3x3 color correction matrix (CCM) maps white-balanced camera RGB into a target color space. For sensor evaluation, the target is usually XYZ:

x^j=[X^jY^jZ^j]=Mcj

The matrix is fit from calibration patches:

M=argminMjwjMcjxj22

where:

  • cj is the white-balanced camera vector for patch j.
  • xj=[Xj,Yj,Zj]T is the reference CIE XYZ vector.
  • wj is an optional patch weight.
  • M is the least-squares CCM.

In matrix form, with camera samples C=[c1,,cn] and references X=[x1,,xn], the unregularized solution is:

M=XCT(CCT)1

If the calibration set is noisy or poorly conditioned, ridge regularization is more stable:

Mα=XCT(CCT+αI)1

The CCM can hide some optical compromises, but it cannot recover information that the sensor never measured. If two different spectra produce the same camera RGB but different XYZ values, no 3x3 matrix can separate them.

Metamerism and Spectral Mismatch

Two spectra are metamers for a sensor when they produce the same camera response:

E(λ)ρa(λ)Qc(λ)dλ=E(λ)ρb(λ)Qc(λ)dλfor all c

They are visually equivalent only if the same equality also holds for the CIE color matching functions. Color error appears when a pair is a camera metamer but not a human-observer metamer, or the reverse.

This is why CFA spectra cannot be optimized only for narrow, saturated primaries. Very narrow RGB filters can increase chromatic separation, but they often reduce signal and can make color correction unstable under LED, fluorescent, or mixed illuminants. Broad filters increase sensitivity but reduce channel independence. The practical design target is a balanced spectral response that supports stable CCM fitting across expected illuminants and materials.

From XYZ to sRGB

sRGB is a display-referred encoding. After estimating XYZ, a D65-adapted XYZ value can be converted to linear sRGB with:

[RlinGlinBlin]=[3.24061.53720.49860.96891.87580.04150.05570.20401.0570][XYZ]

The nonlinear sRGB code value for each clipped linear component u is:

v={12.92u,u0.00313081.055u1/2.40.055,u>0.0031308

where u is a linear-light display RGB component and v is the nonlinear encoded component. This encoding is for display and file interchange. Do not apply it before CCM fitting or Lab error calculations unless the model explicitly expects display-coded values.

Lab and Color Difference

CIE Lab is derived from XYZ relative to a reference white (Xn,Yn,Zn):

L=116f(YYn)16a=500[f(XXn)f(YYn)]b=200[f(YYn)f(ZZn)]

with:

f(t)={t1/3,t>δ3t3δ2+429,tδ3δ=629

The simple 1976 color difference is:

ΔEab=(ΔL)2+(Δa)2+(Δb)2

CIEDE2000, often written ΔE00, modifies the weighting of lightness, chroma, and hue terms to better match visual differences. It is more complex but is the preferred practical metric when comparing camera color accuracy because equal ΔEab steps are not equally visible across the Lab space.

Sensor Design Implications

Color reproduction constrains optical stack design in several ways:

Design choiceColor consequence
CFA center wavelength and bandwidthSets channel separation, sensitivity, and CCM conditioning.
CFA thickness and reliefChanges both spectral passband and angular response, so off-axis color can differ from center-field color.
Microlens focus and CRA shiftAlters which photodiode collects each wavelength and can create color shading near the image edge.
IR-cut transitionResidual NIR leaks into all channels, reducing saturation and corrupting white balance.
Silicon thickness and absorption depthBlue light is absorbed shallowly while red/NIR penetrates deeper, affecting crosstalk and channel balance.
Noise and clippingCCM coefficients can amplify noisy channels, while saturated channels destroy chromatic information.

A robust color design should therefore be evaluated with spectra, not only with RGB endpoint intuition. The minimum useful evaluation set is:

  1. D65 and Illuminant A, plus the LED or fluorescent spectra relevant to the product.
  2. A neutral scale for white balance and exposure.
  3. A patch set with known reflectance spectra, such as a ColorChecker-style target.
  4. Color error before and after CCM.
  5. SNR or noise-amplification checks after the CCM.

COMPASS Workflow

Use the pages in this order when connecting optical simulation to color:

  1. Pixel Optical Effects for CFA, CRA, crosstalk, and stack-level effects.
  2. Quantum Efficiency for converting absorbed power into channel spectral response.
  3. Signal Chain for illuminant, scene reflectance, lens, IR filter, and electron signal.
  4. Color Filter Designer for quick spectral-shape and gamut exploration.
  5. Color Accuracy Analyzer for CCM fitting and color-error intuition.
  6. Signal Chain Color Accuracy for an end-to-end recipe.

For a production sensor, the browser simulators are early design and communication tools. Sign-off requires measured CFA spectra, module transmittance, dark/flat-field calibration, realistic illuminant sets, and validation against silicon images.

References