Color.IPT (Color v0.4.0)

Copy Markdown

IPT perceptual color space (Ebner & Fairchild, 1998).

IPT is a Lab-like opponent color space built on D65 and a simple non-linearity (|x|^0.43). It is the conceptual ancestor of Oklab and JzAzBz and is still used for gamut-mapping work because of its well-behaved hue linearity.

Summary

Types

t()

An IPT colour (Ebner & Fairchild 1998), the Oklab predecessor. Components i (intensity), p (protan-red/green) and t (tritan-yellow/blue) are unit-range floats.

Functions

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

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

Types

t()

@type t() :: %Color.IPT{
  alpha: Color.Types.alpha(),
  i: float() | nil,
  p: float() | nil,
  t: float() | nil
}

An IPT colour (Ebner & Fairchild 1998), the Oklab predecessor. Components i (intensity), p (protan-red/green) and t (tritan-yellow/blue) are unit-range floats.

Functions

from_xyz(xyz)

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

Arguments

Returns

Examples

iex> {:ok, ipt} = Color.IPT.from_xyz(%Color.XYZ{x: 0.95047, y: 1.0, z: 1.08883, illuminant: :D65, observer_angle: 2})
iex> {Float.round(ipt.i, 3), abs(ipt.p) < 1.0e-3, abs(ipt.t) < 1.0e-3}
{1.0, true, true}

to_xyz(ipt)

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