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
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.
Types
@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
Converts CIE XYZ (D65, Y ∈ [0, 1]) to IPT.
Arguments
xyzis aColor.XYZstruct.
Returns
- A
Color.IPTstruct.
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}
Converts IPT to CIE XYZ (D65, Y ∈ [0, 1]).