Documentation
¶
Overview ¶
Package color holds go-gfx's colour helpers. Its first concern is premultiplied alpha: filtering, blending or interpolating straight-alpha pixels lets a transparent pixel's (arbitrary) colour leak into the visible result — the dark or pale fringe around a resized cut-out. Multiplying each colour channel by its alpha first, operating, then dividing back out removes that leak. resample uses these for its Bilinear and Box premultiplied paths; the bicubic and Lanczos paths premultiply in float64 inside the kernel.
Index ¶
- Variables
- func CMYKToSRGB(c CMYK) (r, g, b float64)
- func Clamp01(c float64) float64
- func ClampRGB(r, g, b float64) (float64, float64, float64)
- func DecodeGamma(c, gamma float64) float64
- func DeltaE76(a, b Lab) float64
- func DeltaE94(ref, sample Lab) float64
- func DeltaE2000(c1, c2 Lab) float64
- func DeltaEOK(a, b OKLab) float64
- func EncodeGamma(c, gamma float64) float64
- func HSLToSRGB(h HSL) (r, g, b float64)
- func HSVToSRGB(h HSV) (r, g, b float64)
- func HWBToSRGB(h HWB) (r, g, b float64)
- func InGamut(r, g, b, eps float64) bool
- func LCHToSRGB(c LCH) (r, g, b float64)
- func LabToSRGB(l Lab) (r, g, b float64)
- func LinearToSRGB(c float64) float64
- func LuvToSRGB(l Luv) (r, g, b float64)
- func NormalizeHue(h float64) float64
- func OKLCHToSRGB(c OKLCH) (r, g, b float64)
- func OKLabToLinearRGB(c OKLab) (r, g, b float64)
- func OKLabToSRGB(c OKLab) (r, g, b float64)
- func Premultiply(src []uint8) []uint8
- func QuantizeUnitToByte(v float64) uint8
- func SRGBToLinear(c float64) float64
- func Shade(c color.RGBA, factor float64) color.RGBA
- func SkimageLabToSRGB(l Lab) (r, g, b float64)
- func SkimageXYZToLinearRGB(c XYZ) (r, g, b float64)
- func SkimageXYZToSRGB(c XYZ) (r, g, b float64)
- func UnpremultiplyInPlace(pix []uint8)
- func XYZToLinearRGB(c XYZ) (r, g, b float64)
- func YCbCr601ToSRGB(c YCbCr) (r, g, b float64)
- func YCbCr709ToSRGB(c YCbCr) (r, g, b float64)
- type BlendMode
- type CMYK
- type ColorMatrix
- type HSL
- type HSV
- type HWB
- type LCH
- type Lab
- type Luv
- type OKLCH
- type OKLab
- type RGB
- type WhitePoint
- type XYZ
- func Adapt(c XYZ, src, dst WhitePoint) XYZ
- func AdaptD50ToD65(c XYZ) XYZ
- func AdaptD65ToD50(c XYZ) XYZ
- func LabToXYZ(l Lab) XYZ
- func LabToXYZWP(l Lab, wp WhitePoint) XYZ
- func LinearRGBToXYZ(r, g, b float64) XYZ
- func LuvToXYZ(l Luv) XYZ
- func LuvToXYZWP(l Luv, wp WhitePoint) XYZ
- func SkimageLabToXYZ(l Lab) XYZ
- func SkimageLinearRGBToXYZ(r, g, b float64) XYZ
- func SkimageSRGBToXYZ(r, g, b float64) XYZ
- type YCbCr
Constants ¶
This section is empty.
Variables ¶
var D50 = WhitePoint{X: 0.96422, Y: 1.0, Z: 0.82521}
D50 is the CIE Standard Illuminant D50 (horizon light, ~5003 K) for the 2-deg observer — the connection-space white of ICC profiles and the reference white CSS Color 4 uses for Lab/LCH.
var D65 = WhitePoint{X: 0.95047, Y: 1.0, Z: 1.08883}
D65 is the CIE Standard Illuminant D65 (noon daylight, ~6504 K) for the 2-deg observer — the white point sRGB, Rec.709 and Display-P3 are defined against.
var Rec601Luma = [3]float64{0.213, 0.715, 0.072}
Rec601Luma is the Rec. 601 luminance coefficients (0.213, 0.715, 0.072) that the Filter Effects spec fixes for saturate() and hue-rotate().
var Rec709Luma = [3]float64{0.2126, 0.7152, 0.0722}
Rec709Luma is the Rec. 709 luminance coefficients (0.2126, 0.7152, 0.0722) that the Filter Effects spec fixes for grayscale().
Functions ¶
func CMYKToSRGB ¶ added in v0.4.0
CMYKToSRGB converts a naive CMYK colour back to gamma-encoded sRGB, the inverse of SRGBToCMYK up to the black-recovery rounding.
func ClampRGB ¶ added in v0.4.0
ClampRGB clamps each channel of an RGB triple to [0, 1] independently. This is the crudest gamut mapping: it can shift hue, but never leaves the cube.
func DecodeGamma ¶ added in v0.4.0
DecodeGamma decodes a gamma-encoded channel value c (>= 0) back to linear light with a pure power-law of exponent gamma, returning c**gamma, the inverse of EncodeGamma.
func DeltaE76 ¶ added in v0.4.0
DeltaE76 is the CIE 1976 colour difference: the Euclidean distance between two L*a*b* colours.
func DeltaE94 ¶ added in v0.4.0
DeltaE94 is the CIE 1994 colour difference with the graphic-arts weighting (kL = kC = kH = 1, K1 = 0.045, K2 = 0.015). The metric is asymmetric: ref is the reference (standard) colour and sample the trial colour.
func DeltaE2000 ¶ added in v0.4.0
DeltaE2000 is the CIEDE2000 colour difference between two L*a*b* colours, with the standard weighting factors kL = kC = kH = 1. It follows the reference formulation of Sharma, Wu and Dalal (2005).
func DeltaEOK ¶ added in v0.4.0
DeltaEOK is the OKLab colour difference: the Euclidean distance between two OKLab colours. Because OKLab is perceptually near-uniform this is a simple yet well-behaved metric.
func EncodeGamma ¶ added in v0.4.0
EncodeGamma encodes a linear-light channel value c (>= 0) with a pure power-law of exponent gamma, returning c**(1/gamma).
func HSLToSRGB ¶ added in v0.4.0
HSLToSRGB converts an HSL colour back to gamma-encoded sRGB, the inverse of SRGBToHSL.
func HSVToSRGB ¶ added in v0.4.0
HSVToSRGB converts an HSV colour back to gamma-encoded sRGB, the inverse of SRGBToHSV.
func HWBToSRGB ¶ added in v0.4.0
HWBToSRGB converts an HWB colour back to gamma-encoded sRGB, the inverse of SRGBToHWB. When whiteness and blackness together fill or overflow the range the result is the achromatic grey W/(W+B).
func InGamut ¶ added in v0.4.0
InGamut reports whether every channel of an RGB triple lies within [0, 1] to within eps, i.e. whether the colour is displayable without gamut mapping. Pass eps = 0 for an exact test or a small value (e.g. 1e-6) to absorb rounding.
func LCHToSRGB ¶ added in v0.4.0
LCHToSRGB converts an LCh(ab) colour under D65 back to gamma-encoded sRGB.
func LabToSRGB ¶ added in v0.3.0
LabToSRGB converts a CIE L*a*b* colour to gamma-encoded sRGB (each channel 0..1, not clamped to gamut), the inverse of SRGBToLab.
func LinearToSRGB ¶ added in v0.3.0
LinearToSRGB converts one linear-light channel value (0..1) to its sRGB encoding, the inverse of SRGBToLinear.
func LuvToSRGB ¶ added in v0.4.0
LuvToSRGB converts a CIE L*u*v* colour under D65 back to gamma-encoded sRGB (not clamped to gamut), the inverse of SRGBToLuv.
func NormalizeHue ¶ added in v0.4.0
NormalizeHue folds a hue angle in degrees into the canonical range [0, 360), handling negative angles and multiples of 360. It is applied inside the hue-based inverses, but is exported for callers building hues arithmetically.
func OKLCHToSRGB ¶ added in v0.4.0
OKLCHToSRGB converts an OKLCH colour back to gamma-encoded sRGB (not clamped to gamut), the inverse of SRGBToOKLCH.
func OKLabToLinearRGB ¶ added in v0.4.0
OKLabToLinearRGB converts an OKLab colour to linear-light sRGB primaries (each 0..1 for in-gamut colour), the inverse of LinearRGBToOKLab.
func OKLabToSRGB ¶ added in v0.4.0
OKLabToSRGB converts an OKLab colour to gamma-encoded sRGB (each channel 0..1, not clamped to gamut), the inverse of SRGBToOKLab.
func Premultiply ¶
Premultiply returns a new slice of the straight-alpha RGBA pixels src with each colour channel multiplied by its alpha (rounded to nearest), alpha left unchanged. len(src) must be a multiple of four.
func QuantizeUnitToByte ¶ added in v0.4.0
QuantizeUnitToByte clamps a channel value to [0, 1] and quantises it to an 8-bit value using round-half-to-even, matching scikit-image's img_as_ubyte (numpy.rint). It is the quantisation step image-level consumers apply after SkimageLabToSRGB / SkimageXYZToSRGB to reproduce scikit-image byte output.
func SRGBToLinear ¶ added in v0.3.0
SRGBToLinear converts one sRGB-encoded channel value (0..1) to linear light using the IEC 61966-2-1 electro-optical transfer function.
func Shade ¶ added in v0.6.0
Shade returns c with its gamma-encoded sRGB R, G, B channels multiplied by factor and rounded to the nearest 8-bit value, clamping the result to [0, 255]; alpha is preserved unchanged. A factor below 1 darkens the colour and a factor above 1 lightens it; a negative factor is treated as 0 (black).
This is the diffuse-shading primitive an isometric renderer uses to derive a solid's per-face colours from one base colour: the top face is drawn at factor 1, and the side faces at progressively smaller factors so a lit solid reads with depth. Multiplying the encoded channels (rather than adapting lightness in a perceptual space) reproduces the flat, banded look of the pixel-art isometric convention and is what makes the three faces of a cube distinguishable by a constant ratio.
func SkimageLabToSRGB ¶ added in v0.4.0
SkimageLabToSRGB converts a CIELAB colour to gamma-encoded sRGB (each channel 0..1, not quantised, not gamut-clamped), reproducing skimage.color.lab2rgb before its byte conversion. Inverse of SkimageSRGBToLab.
func SkimageXYZToLinearRGB ¶ added in v0.4.0
SkimageXYZToLinearRGB converts CIE XYZ to linear-light sRGB primaries using scikit-image's inverse matrix, the inverse of SkimageLinearRGBToXYZ.
func SkimageXYZToSRGB ¶ added in v0.4.0
SkimageXYZToSRGB converts CIE XYZ to gamma-encoded sRGB (each channel 0..1, not quantised), reproducing skimage.color.xyz2rgb (the inverse matrix then forward companding), the inverse of SkimageSRGBToXYZ.
func UnpremultiplyInPlace ¶
func UnpremultiplyInPlace(pix []uint8)
UnpremultiplyInPlace divides the colour channels of premultiplied RGBA pixels back out of their alpha, in place, rounding to nearest and clamping to [0, 255]. A fully transparent pixel (alpha 0) is left black. It is the inverse of Premultiply up to rounding. len(pix) must be a multiple of four.
func XYZToLinearRGB ¶ added in v0.3.0
XYZToLinearRGB converts CIE XYZ to linear-light sRGB primaries using the inverse sRGB D65 matrix (values may fall outside [0, 1] for out-of-gamut colours).
func YCbCr601ToSRGB ¶ added in v0.4.0
YCbCr601ToSRGB converts full-range BT.601 Y'CbCr back to gamma-encoded sRGB, the inverse of SRGBToYCbCr601.
func YCbCr709ToSRGB ¶ added in v0.4.0
YCbCr709ToSRGB converts full-range BT.709 Y'CbCr back to gamma-encoded sRGB, the inverse of SRGBToYCbCr709.
Types ¶
type BlendMode ¶ added in v0.3.0
type BlendMode int
BlendMode names a separable blend mode from the W3C Compositing and Blending Level 1 specification. A separable mode blends each colour channel independently: given a backdrop channel Cb and a source channel Cs (both in [0, 1]) it produces the blended channel B(Cb, Cs). BlendMode.Blend evaluates the mode; the formulas match the specification exactly so the results equal the published reference values.
const ( // Normal returns the source unchanged (B = Cs); the default painting mode. Normal BlendMode = iota // Multiply multiplies backdrop and source (B = Cb*Cs); the result is never // lighter than either input. Multiply // Screen is the inverse-multiply complement (B = Cb + Cs - Cb*Cs); never // darker than either input. Screen // Overlay multiplies or screens depending on the backdrop; it is HardLight // with the operands swapped. Overlay // Darken keeps the darker channel (B = min(Cb, Cs)). Darken // Lighten keeps the lighter channel (B = max(Cb, Cs)). Lighten // ColorDodge brightens the backdrop toward white in proportion to the // source. ColorDodge // ColorBurn darkens the backdrop toward black in proportion to the source. ColorBurn // HardLight multiplies or screens depending on the source; it is Overlay // with the operands swapped. HardLight // SoftLight is a gentler HardLight, softening rather than clipping at the // extremes. SoftLight // Difference is the absolute channel difference (B = |Cb - Cs|). Difference // Exclusion is a lower-contrast Difference (B = Cb + Cs - 2*Cb*Cs). Exclusion )
type CMYK ¶ added in v0.4.0
type CMYK struct{ C, M, Y, K float64 }
CMYK is a naive device CMYK colour, each of cyan, magenta, yellow and the black key in [0, 1].
func SRGBToCMYK ¶ added in v0.4.0
SRGBToCMYK converts a gamma-encoded sRGB colour (each channel 0..1) to naive CMYK. Pure black maps to K == 1 with zero coloured ink.
type ColorMatrix ¶ added in v0.5.0
type ColorMatrix [3][4]float64
ColorMatrix is a 3x4 colour transform applied to a gamma-encoded sRGB colour: three rows of [cr cg cb offset]. An output channel is cr*R + cg*G + cb*B + offset, with R, G, B and the offset in [0, 1]; alpha is not touched by these operations, so it is not part of the matrix. A consumer working in another numeric range (e.g. 0..255 bytes) scales the offset by its full-scale value.
func BrightnessMatrix ¶ added in v0.5.0
func BrightnessMatrix(a float64) ColorMatrix
BrightnessMatrix is CSS brightness(a): a per-channel linear multiply by a (a >= 0, may exceed 1). It is a scale, not the additive brightness of an image-processing "adjust brightness".
func GrayscaleMatrix ¶ added in v0.5.0
func GrayscaleMatrix(a float64) ColorMatrix
GrayscaleMatrix is CSS grayscale(a): the saturation matrix at s = 1-a with Rec. 709 luma, so a interpolates from the original (a = 0) towards full luminance grey (a = 1).
func HueRotateMatrix ¶ added in v0.5.0
func HueRotateMatrix(rad float64) ColorMatrix
HueRotateMatrix is CSS hue-rotate(rad) / SVG feColorMatrix type="hueRotate": a rotation of the colour about the luminance axis by rad radians, built from the fixed constant, cosine and sine matrices of the Filter Effects spec.
func InvertMatrix ¶ added in v0.5.0
func InvertMatrix(a float64) ColorMatrix
InvertMatrix is CSS invert(a): each channel interpolates towards its negative by a, out = (1-2a)*in + a. a = 1 is a full photographic negative.
func SaturateMatrix ¶ added in v0.5.0
func SaturateMatrix(s float64) ColorMatrix
SaturateMatrix is CSS saturate(s) / SVG feColorMatrix type="saturate": the saturation matrix at factor s with Rec. 601 luma. s may exceed 1.
func SepiaMatrix ¶ added in v0.5.0
func SepiaMatrix(a float64) ColorMatrix
SepiaMatrix is CSS sepia(a): a = 1 is full sepia tone, a = 0 is identity.
func (ColorMatrix) Apply ¶ added in v0.5.0
func (m ColorMatrix) Apply(r, g, b float64) (float64, float64, float64)
Apply transforms one gamma-encoded sRGB colour (channels in [0, 1]) by m, returning the three output channels unclamped (a saturation or hue rotation can push a channel slightly outside [0, 1]; the caller clamps to its range).
type HSL ¶ added in v0.4.0
type HSL struct{ H, S, L float64 }
HSL is a colour in the hue/saturation/lightness cylinder of gamma-encoded sRGB. H is in degrees [0, 360); S and L are in [0, 1].
type HSV ¶ added in v0.4.0
type HSV struct{ H, S, V float64 }
HSV is a colour in the hue/saturation/value cylinder of gamma-encoded sRGB. H is in degrees [0, 360); S and V are in [0, 1].
type HWB ¶ added in v0.4.0
type HWB struct{ H, W, B float64 }
HWB is a colour in the hue/whiteness/blackness model of gamma-encoded sRGB. H is in degrees [0, 360); W and B are in [0, 1].
type LCH ¶ added in v0.4.0
type LCH struct{ L, C, H float64 }
LCH is a colour in a cylindrical CIE space: L is lightness, C is chroma (radial) and H is the hue angle in degrees [0, 360). It represents both LCh(ab) (from Lab) and LCh(uv) (from Luv); which one is fixed by the conversion that produced it.
type Lab ¶ added in v0.3.0
type Lab struct{ L, A, B float64 }
Lab is a colour in the CIE L*a*b* space: L* is lightness (0 black .. 100 diffuse white), a* is the green(-)/red(+) axis and b* the blue(-)/yellow(+) axis.
func LCHToLab ¶ added in v0.4.0
LCHToLab converts cylindrical LCh(ab) back to CIE L*a*b*, the inverse of LabToLCH.
func SRGBToLab ¶ added in v0.3.0
SRGBToLab converts an sRGB colour (each channel 0..1, gamma-encoded) to CIE L*a*b*, chaining sRGB->linear->XYZ->Lab.
func SkimageSRGBToLab ¶ added in v0.4.0
SkimageSRGBToLab converts a gamma-encoded sRGB colour to CIELAB, reproducing skimage.color.rgb2lab (rgb2xyz composed with xyz2lab). Because it uses scikit-image's matrix and white together, pure white maps to Lab (100, -0.00245, 0.00465), exactly as scikit-image does.
func SkimageXYZToLab ¶ added in v0.4.0
SkimageXYZToLab converts CIE XYZ to CIELAB relative to the D65 white, matching skimage.color.xyz2lab (its constants and reference white).
func XYZToLabWP ¶ added in v0.4.0
func XYZToLabWP(c XYZ, wp WhitePoint) Lab
XYZToLabWP converts CIE XYZ to CIE L*a*b* relative to the white point wp.
type Luv ¶ added in v0.4.0
type Luv struct{ L, U, V float64 }
Luv is a colour in CIE 1976 L*u*v*: L is lightness (0..100) and u*, v* are the chromatic axes.
func LCHToLuv ¶ added in v0.4.0
LCHToLuv converts cylindrical LCh(uv) back to CIE L*u*v*, the inverse of LuvToLCH.
func SRGBToLuv ¶ added in v0.4.0
SRGBToLuv converts a gamma-encoded sRGB colour to CIE L*u*v* under D65.
func XYZToLuvWP ¶ added in v0.4.0
func XYZToLuvWP(c XYZ, wp WhitePoint) Luv
XYZToLuvWP converts CIE XYZ to CIE L*u*v* relative to the white point wp.
type OKLCH ¶ added in v0.4.0
type OKLCH struct{ L, C, H float64 }
OKLCH is the cylindrical form of OKLab: L is lightness (0..1), C is chroma and H is the hue angle in degrees [0, 360).
func OKLabToOKLCH ¶ added in v0.4.0
OKLabToOKLCH converts OKLab to its cylindrical form OKLCH.
func SRGBToOKLCH ¶ added in v0.4.0
SRGBToOKLCH converts a gamma-encoded sRGB colour to OKLCH.
type OKLab ¶ added in v0.4.0
type OKLab struct{ L, A, B float64 }
OKLab is a colour in Ottosson's OKLab space: L is lightness (0..1), A is the green(-)/red(+) axis and B the blue(-)/yellow(+) axis.
func LinearRGBToOKLab ¶ added in v0.4.0
LinearRGBToOKLab converts linear-light sRGB primaries (each 0..1) to OKLab.
func OKLCHToOKLab ¶ added in v0.4.0
OKLCHToOKLab converts cylindrical OKLCH back to OKLab, the inverse of OKLabToOKLCH.
func SRGBToOKLab ¶ added in v0.4.0
SRGBToOKLab converts a gamma-encoded sRGB colour (each channel 0..1) to OKLab.
type RGB ¶ added in v0.4.0
type RGB struct{ R, G, B float64 }
RGB is a gamma-encoded sRGB triple with each channel in [0, 1], the operand of the non-separable blend modes.
func BlendColor ¶ added in v0.4.0
BlendColor is the W3C Color blend: the hue and saturation of the source with the luminosity of the backdrop.
func BlendHue ¶ added in v0.4.0
BlendHue is the W3C Hue blend: the hue of the source with the saturation and luminosity of the backdrop.
func BlendLuminosity ¶ added in v0.4.0
BlendLuminosity is the W3C Luminosity blend: the luminosity of the source with the hue and saturation of the backdrop.
func BlendSaturation ¶ added in v0.4.0
BlendSaturation is the W3C Saturation blend: the saturation of the source with the hue and luminosity of the backdrop.
type WhitePoint ¶ added in v0.4.0
type WhitePoint struct{ X, Y, Z float64 }
WhitePoint is a reference white in CIE 1931 XYZ, its luminance Y normalised to 1. It is the illuminant a device-independent colour space is measured against.
type XYZ ¶ added in v0.3.0
type XYZ struct{ X, Y, Z float64 }
XYZ is a colour in the CIE 1931 XYZ space (D65-referenced here). Y is luminance; for in-gamut linear sRGB the components lie roughly in [0, 1].
func Adapt ¶ added in v0.4.0
func Adapt(c XYZ, src, dst WhitePoint) XYZ
Adapt returns the CIE XYZ colour c, measured under illuminant src, expressed under illuminant dst using the Bradford chromatic-adaptation transform. When src == dst the colour is returned unchanged up to floating-point rounding.
func AdaptD50ToD65 ¶ added in v0.4.0
AdaptD50ToD65 carries a CIE XYZ colour from the D50 white point to D65.
func AdaptD65ToD50 ¶ added in v0.4.0
AdaptD65ToD50 carries a CIE XYZ colour from the D65 white point to D50.
func LabToXYZ ¶ added in v0.3.0
LabToXYZ converts CIE L*a*b* back to CIE XYZ (D65), the inverse of XYZToLab.
func LabToXYZWP ¶ added in v0.4.0
func LabToXYZWP(l Lab, wp WhitePoint) XYZ
LabToXYZWP converts CIE L*a*b* back to CIE XYZ relative to the white point wp, the inverse of XYZToLabWP.
func LinearRGBToXYZ ¶ added in v0.3.0
LinearRGBToXYZ converts linear-light sRGB primaries (each 0..1) to CIE XYZ using the standard sRGB D65 matrix.
func LuvToXYZ ¶ added in v0.4.0
LuvToXYZ converts CIE L*u*v* back to CIE XYZ (D65), the inverse of XYZToLuv.
func LuvToXYZWP ¶ added in v0.4.0
func LuvToXYZWP(l Luv, wp WhitePoint) XYZ
LuvToXYZWP converts CIE L*u*v* back to CIE XYZ relative to the white point wp, the inverse of XYZToLuvWP.
func SkimageLabToXYZ ¶ added in v0.4.0
SkimageLabToXYZ converts CIELAB back to CIE XYZ, matching skimage.color .lab2xyz — including its clip of a negative Z in f-space, applied BEFORE the inverse nonlinearity rather than after it. Inverse of SkimageXYZToLab.
func SkimageLinearRGBToXYZ ¶ added in v0.4.0
SkimageLinearRGBToXYZ converts linear-light sRGB primaries to CIE XYZ using scikit-image's matrix (skimage.color rgb2xyz without the companding step).
func SkimageSRGBToXYZ ¶ added in v0.4.0
SkimageSRGBToXYZ converts a gamma-encoded sRGB colour (each channel 0..1) to CIE XYZ, reproducing skimage.color.rgb2xyz (inverse companding then the scikit-image matrix).
type YCbCr ¶ added in v0.4.0
type YCbCr struct{ Y, Cb, Cr float64 }
YCbCr is a full-range Y'CbCr colour: Y is luma in [0, 1]; Cb and Cr are the blue- and red-difference chroma in [0, 1], neutral at 0.5.
func SRGBToYCbCr601 ¶ added in v0.4.0
SRGBToYCbCr601 converts a gamma-encoded sRGB colour to full-range Y'CbCr with ITU-R BT.601 (SDTV) luma weights.
func SRGBToYCbCr709 ¶ added in v0.4.0
SRGBToYCbCr709 converts a gamma-encoded sRGB colour to full-range Y'CbCr with ITU-R BT.709 (HDTV) luma weights.