me

Hello!
I’m Chris or @svgeesus

Technical Director at W3C
Strategy lead, Core Web Technologies

Topics for today

The Prehistoric Web

ITU Rec BT.709 (1990) part 2
1080i and 1080p High Definition TV
Defines chromaticities, D65 white
OETF with linear segment
Scene referred
Overall system gamma 1.2 (dim surround)

CRT monitor

Indexed-color displays
16 color VGA displays. 256 colors common.
“Truecolor” for the lucky few
Gamma mayhem
Mac: 2.6/1.45 = 1.79
SGI: 2.4/1.7 = 1.4
PC, Unix: 2.2 (ish)

W3C Print Workshop

sRGB proposal

sRGB
Same chromaticities, D65 white as BT.709
“Inverse OETF” with linear segment
Display referred
Overall system gamma 1.0 (normal surround)
Assumes 5% viewing flare

Cascading Style Sheets

CSS1 uses sRGB

Color managed screens

Color Management arrives
Mac: ColorSync
Win95/NT: Kodak CMS (aftermarket)
Win98/2000: ICM
WinXP: ICM 2.0
Linux/GNOME: GNOME Color Manager
Linux/KDE: colord-kde

Success!

Not so fast

Web vs. Everything Else

Color Management in Industry

Commercial printing, production of paint, plastics, fabric, 3D print

Color Management on the Web

Even with color-managed screens:

CSS Color 3 (2011)

sRGB only, 8 bits per component

Chrome, Safari color managed; Firefox threw data at screen

fill: rgb(243, 214, 155);
// looks fine on sRGB,
// too saturated on P3 wide gamut

Broadcast

DCI P3 - SMPTE EG 432 (2005)
Digital Cinema Initiative
Projectors for digital cinema
Defines chromaticities, weird white
Monochromatic red, 615nm
White luminance 48 cd/m²
Dark surround
UltraHD Premium
Conforming devices required to display at least 90% of DCI P3
UHD Premium logo
VESA DisplayHDR
(For tier 500 and greater)
Conforming devices required to display at least 90% of DCI P3
Display HDR logo
Apple Display P3
White, EOTF, viewing conditions same as sRGB
Primaries same as DCI-P3
Display-referred
Factory-calibrated phones, tablets, laptops, watches
All color managed
ITU Rec BT.2020 (2012)
Ultrawide gamut
Monochromatic primaries (630, 532, 467nm)
10 or 12 bits per component
OETF, and non-matching EOTF (gamma 2.4)
D65 white, dim surround
Display-referred
UltraHD (4k, 8k) broadcast, streaming
BT.2020 in practice
Content mostly mastered in DCI-P3
HDMI 2.0 supports BT.2020, 12bit
Content thus delivered in BT.2020 container
For HDR, metadata declares the mastering gamut volume

CSS Color 4

CSS Color 4

What changed?

Predefined Colorspaces

fill: color(display-p3 0.9341 0.8433 0.6361)
fill: color(prophoto-rgb 0.8474 0.8103 0.5824)
fill: color(rec2020 0.9151 0.8359 0.5960)
// these are the same color, L=87.16 C=38.25 H=79.93

CIE Hue, Chroma (LCH)

LCH in CSS Color 4

background: lch(50% 0 0);
border-color: lch(65% 30 180 / 50%);
color: lch(55.3% 84.5 10.25, #F06);

Hue can be NaN for neutrals

CIE a & b

Lab a scale Lab b scale

Lab in CSS Color 4

background: lab(50% 0 0);
border-color: lab(65% 46 -8 / 50%);
color: lab(55.3% 83.1 15.0 / 75%, #F06);

CMYK: ICC Color in CSS Color 4

At-rule (like @font-face) points to ICC profile

@color-profile --fogra39 {
   src: url('https://example.org/C_Fogra39L.icc');
}
.header {
   background-color: color(--fogra39 0% 70% 20% 0%);
}

CMYKOGV: ICC Color in CSS Color 4

Not limited to 4 components

@color-profile --fogra55beta {
  src: url('https://example.org/FOGRA55beta_CL.icc');
}
.bluish_green {
  background-color:
  color(--fogra55beta 0.397575 0.010047 0.223682
        0.031140 0.000000 0.317066 0.000000);
}

Mixing & manipulating colors

CSS Color 5: manipulating color

Mixing colors in CSS Color 5

Two colors can be mixed in any colorspace; default is LCH

color-mix(teal 65%, olive);

Mixing colors in CSS Color 5

Individual components can be mixed

--tomato: lch(52% 58.1 22.7);
--sky: lch(56% 49.1 257.1);
color-mix(var(--tomato) hue 75.23%, var(--sky));
Mix colors
Can be in different colorspaces
Space for mixing (LCH, Lab, XYZ)
Can specify long arc for hue mixing
Result can be out of gamut, needs gamut mapping

Most contrasting color in CSS Color 5

Base color, list of alternates

--myAccent: #b22222;
color-contrast(wheat vs tan, sienna, var(--myAccent), #d2691e)

WCAG Contrast = (Yb + 0.05) / (Ya + 0.05)

Color Luminance Contrast
    0.749
    0.482 1.501
    0.137 4.273
    0.107 5.081
    0.305 2.249

High Dynamic Range

Need for HDR

Consumer WCG, HDR films, series, news, sports (BT.2100 PQ, HLG)

Consumer HDR gaming consoles

Consumer WCG, HDR-ready TVs commonplace

Consumer WCG (P3) laptops, tablets, phones; HDR coming

WCG, HDR still images coming (AVIF)

ITU Rec BT.2100 (2016)
BT.2020 gamut
10 or 12 bits per component
D65 white, dim surround
PQ or HLG
Hybrid Log Gamma
Scene-referred, relative luminance
Diffuse white at 0.75
2.5 stops highlights
Range of viewing environments (dim to bright)
Brighter displays for brighter environments
Perceptual Quantizer
Reference display referred, absolute luminance
Diffuse white varies (0.54, 0.58, 0.66)?
5.5 stops highlights
Dim viewing environment
Brighter displays for more highlights
Problems with CIE Lab
Hue non-linearity in blue area
Primarily designed for reflective, low-luminance (120 cd/m²), print gamuts
Hard to extend for specular whites brighter than paper white
Under-tested for wide-gamut colors, over-estimates ΔE

CSS Color HDR: high dynamic range

CSS Color HDR (unofficial draft)
Adds BT.2100 (both HLG & PQ)
Adds Jzazbz & JzCzhz (PQ-like, on LMS)
Adds ICTCP (PQ on LMS)
Defines SDR & HDR compositing (ITU Rpt BT.2408-0)

Future challenges

CSS Compositing
Currently gamma-encoded sRGB default, for legacy Web/Photoshop compatibility
Porter-Duff compositing operators
Ideal is compositing in linear-light, such as XYZ
CSS gradients
Currently interpolate in alpha-premultiplied gamma-encoded sRGB space
Ideal is alpha-premultiplied, perceptually linear, chroma-preserving (LCH or JzCzhz)
Canvas (2D rendering context)
Currently gamma-encoded sRGB default, 8bits/component
Now adding other colorspaces from CSS Color 4
Adding 16-bit and half-float sRGB for WCG (and HDR?)
CSS Object Model
Assumes colors are 8-bit sRGB
String (serialization) based
Huge legacy JS codebase
CSS Color 4 extends with serialization of color()
CSS Typed Object Model (in development)
Expert review
W3C Colorweb Community Group
W3C joined ICC
W3C Workshop on WCG & HDR
Virtual, April 2021
Speaker submissions welcome
W3C