3-Color Cusps of sRGB Gamut in ZCAM

Earlier this year I had to investigate perception of colour attributes for some of my projects. There exists a long history of colour models that try to approximate perception, each with its own shortcomings and complexities. For a decent modern colour space suitable for image processing and with accompanying C code, OkLab can be recommended (based on CAM16 and to some extend IPT).

But for my needs, I ended up implementing a more recently released model: ZCAM, a colour appearance model based on a high dynamic range uniform colour space. ZCAM is a new colour appearance model published in 2020, it is based on the Jzazbz colour space, attempts to improve on the existing colour appearance models and provides a computable inverse. This makes it suitable for forward and backwards conversions between practical colour spaces like sRGB and the ZCAM colour appearance model parameters for image processing and with some effort gamut clipping.

The code is hosted on GitHub: zcam-js
And it is available as an npm module: zcam-js

Using the test cases provided by the ZCAM paper authors in Supplementary document for ZCAM, a psychophysical model for colour appearance prediction, a test battery could be constructed to validate forward and backward transforms of various combinations of parameters. A number of challenges were encountered while validating the provided test results:

The implementation now supports transforms from the XYZ colour space (or sRGB) to the ZCAM parameters Jz, Qz, Cz, Sz, Mz, Vz, Wz, Kz, hz, Hz (described below). Colour space inputs under white points other than CIE D65 are adapted using CAT02 as demanded by the ZCAM paper.

And it supports back transforms into XYZ/sRGB/etc colour spaces (while inverting the white point adaption if needed) from three of the ZCAM colour appearance model parameters: one of lightness Jz or brightness Qz, one of chroma Cz or saturation Sz or colourfulness Mz or vividness Vz or whiteness Wz or blackness Kz, and one of hue angle hz or hue composition Hz.

Also, the code now contains functions to find the chroma & lightness cusps for a given hue and the chroma maximum for a given hue and brightness within a gamut, needed for gamut clipping.

The following video shows the sRGB Chroma/Lightness cusps across all hues in ZCAM, the chroma maximum for a specific lightness (Y axis) corresponds to the rightmost pixel that is still visible (i.e. inside the gamut): ZCAM (Cz, Jz) per Hue

Post comment via email