rgb_to_lab — IMGMETRICS colorspace op

• Data kinds: rgbimage → lab

• Call: import fullseye as fs; fs.ledger.rgb_to_lab(rgb, white=(0.95047, 1.0, 1.08883)) (to call the implementation directly, import imgmetrics; imgmetrics.rgb_to_lab(rgb, white=(0.95047, 1.0, 1.08883)); from the registry, opsimgmetrics.get("rgb_to_lab"))

Usage

sRGB → CIE L*a*b* (D65). The step before measuring ΔE.

The composition xyz_to_lab(rgb_to_xyz(rgb), white). Validation and failure conditions follow those 2:

• rgb: last axis is 3. Integer dtypes are normalised to [0, 1] by the dtype maximum; float must lie in [0, 1] (otherwise MetricContractError). Pass gamma-encoded sRGB, not linear RGB.

• white: the Lab white point. The sRGB matrix is fixed to D65, so normally leave the default.

• Return value: float64 of the same shape as the input. L is in [0, 100]; white (1, 1, 1) gives approximately (100, 0, 0).

For the colour difference of 2 images, delta_e_map does everything from conversion to colour difference in one go. lab_to_rgb converts back, but out-of-gamut colours are clipped.

Detailed usage guide

• image_difference_metrics family guide

Background guides (the physics and conventions behind this op)

• colorimetry — Colorimetry and spectra — colour is fixed only by spectrum × illuminant × observer

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

• image_quality_metrics — py -3.11 examples/image_quality_metrics.py

• poc_colormap_readability — py -3.11 examples/poc_colormap_readability.py

• poc_leaf_disease_area — py -3.11 examples/poc_leaf_disease_area.py

• poc_solder_fillet_aoi — py -3.11 examples/poc_solder_fillet_aoi.py

Ops the type connects to (they accept lab as input)

lab_to_rgb · delta_e_2000 · delta_e_76 · luma_limited_u8 · rank_data · tid2013_index

Same category (colorspace)

lab_to_rgb · rgb_to_xyz · xyz_to_lab


*Provenance: imgmetrics.py — IMGMETRICS operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.