Skip to content

Spatial cielab

Brian Wandell edited this page Aug 24, 2026 · 1 revision

Spatial CIELAB (S-CIELAB)

Ordinary CIELAB color difference (see Metrics) compares two colors pixel by pixel, as if the eye had unlimited spatial resolution for color errors. In practice the eye is far less sensitive to high-spatial-frequency color error than to high-spatial-frequency luminance error — a compression artifact that shifts colors slightly in a fine-textured region is much less visible than the same shift over a large uniform area. Spatial CIELAB (S-CIELAB) accounts for this: it filters the color-opponent channels with a model of the eye's reduced high-frequency color sensitivity before computing an ordinary CIELAB difference, so the resulting error map reflects perceived rather than pixelwise color error.

Computing it

The core computation is implemented in metrics/scielab/:

  • scielab — the main entry point, comparing two images (or two scenes) and returning a spatial CIELAB error map.
  • preSCIELAB — applies the spatial (opponent-color) filtering step.
  • scComputeSCIELAB — the lower-level computation given the filtered data.
  • scielabRGB — a convenience wrapper for comparing two RGB images directly, handling the color-space conversion for you.
  • scielabMask — restricts the comparison to a region of interest.
% errorImage is the S-CIELAB error at each pixel, comparing image1 to
% image2 under the given display's calibrated primaries.
errorImage = scielabRGB(image1, image2, displayCreate('LCD-Apple'));

Tutorials

t_metricsScielab and t_metricsScielab2 in tutorials/metrics/ cover this calculation; unlike most tutorials linked elsewhere in this wiki, they are not yet published as HTML — read the source directly: t_metricsScielab.m, t_metricsScielab2.m.

Back to Metrics.

Clone this wiki locally