Color.JzAzBz (Color v0.4.0)

Copy Markdown

JzAzBz perceptually-uniform color space for HDR and wide-gamut content, from Safdar, Cui, Kim & Luo (2017), "Perceptually uniform color space for image signals including high dynamic range and wide gamut".

JzAzBz is designed on top of CIE XYZ under D65 expressed in absolute luminance (cd/m²). Our Color.XYZ is on the Y = 1.0 scale, so we multiply by a reference peak luminance before the JzAzBz transform and divide on the way back.

The default reference luminance is 100 cd/m², which matches the traditional SDR reference white and produces Jz values consistent with the JzAzBz paper's examples. For HDR workflows, pass :reference_luminance (in cd/m², up to 10,000) as an option.

Summary

Types

t()

A JzAzBz colour (Safdar et al. 2017), an HDR/wide-gamut perceptual space. jz is lightness, az and bz are chromatic axes.

Functions

Converts CIE XYZ (D65, Y ∈ [0, 1]) to JzAzBz.

Converts JzAzBz to CIE XYZ (D65, Y ∈ [0, 1]).

Types

t()

@type t() :: %Color.JzAzBz{
  alpha: Color.Types.alpha(),
  az: float() | nil,
  bz: float() | nil,
  jz: float() | nil
}

A JzAzBz colour (Safdar et al. 2017), an HDR/wide-gamut perceptual space. jz is lightness, az and bz are chromatic axes.

Functions

from_xyz(xyz, options \\ [])

Converts CIE XYZ (D65, Y ∈ [0, 1]) to JzAzBz.

Arguments

Returns

Examples

iex> {:ok, jz} = Color.JzAzBz.from_xyz(%Color.XYZ{x: 0.95047, y: 1.0, z: 1.08883, illuminant: :D65, observer_angle: 2})
iex> {Float.round(jz.jz, 4), abs(jz.az) < 1.0e-3, abs(jz.bz) < 1.0e-3}
{0.1672, true, true}

to_xyz(jzazbz, options \\ [])

Converts JzAzBz to CIE XYZ (D65, Y ∈ [0, 1]).

Arguments

Returns