rgb_to_xyz — IMGMETRICS colorspace op

• Data kinds: rgbimage → rgb

• Call: import fullseye as fs; fs.ledger.rgb_to_xyz(rgb) (to call the implementation directly, import imgmetrics; imgmetrics.rgb_to_xyz(rgb); from the registry, opsimgmetrics.get("rgb_to_xyz"))

Usage

sRGB ((..., 3)) → CIE XYZ. The transfer function is removed first, then the matrix is applied.

Procedure: srgb_to_linear normalises integer dtypes to [0, 1] while removing the transfer function (IEC 61966-2-1), then the sRGB (D65)→XYZ 3x3 matrix is applied to linear RGB. White (1, 1, 1) maps to (0.9505, 1.0, 1.0890) (a scale with Y normalised to 1).

• Input: any shape as long as the last axis is 3 (1 colour (3,), a colour table (N, 3), an image (H, W, 3)). Integer dtypes (uint8/uint16 etc.) are divided by the dtype maximum. float that does not lie in [0, 1] gives MetricContractError (ValueError subtype). Note that passing linear values with gamma already removed removes the gamma twice.

• Return value: float64 of the same shape as the input.

• Failure: the last axis is not 3 / float outside [0, 1] / non-finite.

The usual next step is to chain xyz_to_lab (rgb_to_lab does both).

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

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

xyz_to_lab · luma_limited_u8 · rank_data · tid2013_index

Same category (colorspace)

rgb_to_lab · lab_to_rgb · 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.