cutcutcodec.core.colorspace.cst

Regroup all standard color space constants.

The ffmpeg constants are defined on the ffmpeg colorspace website, or are described somewhere in ffmpeg -h full.

The tristimulus and transfer functions are taken from the International Telecomunication Union Recomandation ITU-T H.273 (V4).

PRIMARIES

The tristimulus primaries colors (gamut), defined in the CIE XY space.

name

red

green

blue

white

bt2020

x=0.708, y=0.292

x=0.170, y=0.797

x=0.131, y=0.046

x=0.3127, y=0.3290

bt470bg

x=0.64, y=0.33

x=0.29, y=0.60

x=0.15, y=0.06

x=0.3127, y=0.329

bt470m

x=0.67, y=0.33

x=0.21, y=0.71

x=0.14, y=0.08

x=0.310, y=0.316

bt709

x=0.64, y=0.33

x=0.3, y=0.6

x=0.15, y=0.06

x=0.3127, y=0.329

film

x=0.681, y=0.319

x=0.243, y=0.692

x=0.145, y=0.049

x=0.310, y=0.316

jedec-p22, ebu3213

x=0.630, y=0.340

x=0.295, y=0.605

x=0.155, y=0.077

x=0.3127, y=0.3290

ntsc

x=0.630, y=0.340

x=0.310, y=0.595

x=0.155, y=0.070

x=0.3127, y=0.329

pal

x=0.64, y=0.33

x=0.29, y=0.60

x=0.15, y=0.06

x=0.3127, y=0.329

smpte170m

x=0.630, y=0.340

x=0.310, y=0.595

x=0.155, y=0.070

x=0.3127, y=0.329

smpte240m

x=0.630, y=0.340

x=0.310, y=0.595

x=0.155, y=0.070

x=0.3127, y=0.329

smpte428, smpte428_1

x=1, y=0

x=0, y=1

x=0, y=0

x=1/3, y=1/3

smpte431

x=0.680, y=0.320

x=0.265, y=0.690

x=0.150, y=0.060

x=0.314, y=0.351

smpte432

x=0.680, y=0.320

x=0.265, y=0.690

x=0.150, y=0.060

x=0.3127, y=0.3290

srgb

x=0.64, y=0.33

x=0.3, y=0.6

x=0.15, y=0.06

x=0.3127, y=0.329

TRC

The transfer functions (gamma), Let the luminance be Y or L, the luma Y” or V.

name

\(V = f(L)\)

\(L = f^{-1}(V)\)

arib-std-b67

\(\min\left(1, \max\left(0, \begin{cases} 0.17883277 \log{\left(12.0 L - 0.28466892 \right)} + 0.55991073 & \text{for}\: L > 0.0833333333333333 \\1.73205080756888 \sqrt{L} & \text{otherwise} \end{cases}\right)\right)\)

\(\begin{cases} 0.00363980706887607 e^{5.59181630972892 V} + 0.02372241 & \text{for}\: V > 0.5 \\0.333333333333333 V^{2} & \text{otherwise} \end{cases}\)

bt1361e, bt1361

\(\min\left(1, \max\left(0, \begin{cases} 1.09929682680944 L^{0.45} - 0.099296826809443 & \text{for}\: L \geq 0.0180539685108078 \\4.5 L & \text{otherwise} \end{cases}\right)\right)\)

\(\begin{cases} 0.222222222222222 V & \text{for}\: V \leq 0.0812428582986352 \\0.810276773963953 \left(V + 0.099296826809443\right)^{2.22222222222222} & \text{otherwise} \end{cases}\)

bt2020

\(\min\left(1, \max\left(0, \begin{cases} 1.09929682680944 L^{0.45} - 0.099296826809443 & \text{for}\: L \geq 0.0180539685108078 \\4.5 L & \text{otherwise} \end{cases}\right)\right)\)

\(\begin{cases} 0.222222222222222 V & \text{for}\: V \leq 0.0812428582986352 \\0.810276773963953 \left(V + 0.099296826809443\right)^{2.22222222222222} & \text{otherwise} \end{cases}\)

bt2020-10, bt2020_10bit

\(\min\left(1, \max\left(0, \begin{cases} 1.09929682680944 L^{0.45} - 0.099296826809443 & \text{for}\: L \geq 0.0180539685108078 \\4.5 L & \text{otherwise} \end{cases}\right)\right)\)

\(\begin{cases} 0.222222222222222 V & \text{for}\: V \leq 0.0812428582986352 \\0.810276773963953 \left(V + 0.099296826809443\right)^{2.22222222222222} & \text{otherwise} \end{cases}\)

bt2020-12, bt2020_12bit

\(\min\left(1, \max\left(0, \begin{cases} 1.09929682680944 L^{0.45} - 0.099296826809443 & \text{for}\: L \geq 0.0180539685108078 \\4.5 L & \text{otherwise} \end{cases}\right)\right)\)

\(\begin{cases} 0.222222222222222 V & \text{for}\: V \leq 0.0812428582986352 \\0.810276773963953 \left(V + 0.099296826809443\right)^{2.22222222222222} & \text{otherwise} \end{cases}\)

bt470bg

\(\min\left(1, \max\left(0, L^{0.357142857142857}\right)\right)\)

\(V^{2.8}\)

bt470m

\(\min\left(1, \max\left(0, L^{0.454545454545455}\right)\right)\)

\(V^{2.2}\)

bt709

\(\min\left(1, \max\left(0, \begin{cases} 1.09929682680944 L^{0.45} - 0.099296826809443 & \text{for}\: L \geq 0.0180539685108078 \\4.5 L & \text{otherwise} \end{cases}\right)\right)\)

\(\begin{cases} 0.222222222222222 V & \text{for}\: V \leq 0.0812428582986352 \\0.810276773963953 \left(V + 0.099296826809443\right)^{2.22222222222222} & \text{otherwise} \end{cases}\)

gamma22

\(\min\left(1, \max\left(0, L^{0.454545454545455}\right)\right)\)

\(V^{2.2}\)

gamma28

\(\min\left(1, \max\left(0, L^{0.357142857142857}\right)\right)\)

\(V^{2.8}\)

iec61966-2-1, iec61966_2_1

\(\min\left(1, \max\left(0, \begin{cases} 1.05501071894759 L^{0.416666666666667} - 0.0550107189475866 & \text{for}\: L \geq 0.00304128256012752 \\12.92 L & \text{otherwise} \end{cases}\right)\right)\)

\(\begin{cases} 0.0773993808049536 V & \text{for}\: V \leq 0.0392933706768475 \\0.879394017810642 \left(V + 0.0550107189475866\right)^{2.4} & \text{otherwise} \end{cases}\)

iec61966-2-4, iec61966_2_4

\(\operatorname{sign}{\left(L \right)} \min\left(1, \max\left(0, \begin{cases} 1.09929682680944 \left|{L}\right|^{0.45} - 0.099296826809443 & \text{for}\: \left|{L}\right| \geq 0.0180539685108078 \\4.5 \left|{L}\right| & \text{otherwise} \end{cases}\right)\right)\)

\(\begin{cases} 0.222222222222222 V & \text{for}\: V \leq 0.0812428582986352 \\0.810276773963953 \left(V + 0.099296826809443\right)^{2.22222222222222} & \text{otherwise} \end{cases}\)

linear

\(\min\left(1, \max\left(0, L\right)\right)\)

\(V\)

log100, log

\(\min\left(1, \max\left(0, \frac{L}{65536}, \frac{\log{\left(L \right)}}{2 \log{\left(10 \right)}} + 1\right)\right)\)

\(\min\left(10^{2 V - 2}, 65536 V\right)\)

log316, log_sqrt

\(\min\left(1, \max\left(0, \frac{L}{65536}, \frac{0.4 \log{\left(L \right)}}{\log{\left(10 \right)}} + 1\right)\right)\)

\(\min\left(10^{2.5 V - 2.5}, 65536 V\right)\)

smpte170m

\(\min\left(1, \max\left(0, \begin{cases} 1.09929682680944 L^{0.45} - 0.099296826809443 & \text{for}\: L \geq 0.0180539685108078 \\4.5 L & \text{otherwise} \end{cases}\right)\right)\)

\(\begin{cases} 0.222222222222222 V & \text{for}\: V \leq 0.0812428582986352 \\0.810276773963953 \left(V + 0.099296826809443\right)^{2.22222222222222} & \text{otherwise} \end{cases}\)

smpte2084

\(\min\left(1, \max\left(0, \left(\frac{18.8515625 L^{0.1593017578125} + 0.8359375}{18.6875 L^{0.1593017578125} + 1}\right)^{78.84375}\right)\right)\)

\(\left(\frac{0.8359375 - V^{0.012683313515656}}{\frac{299 V^{0.012683313515656}}{16} - 18.8515625}\right)^{6.27739463601533}\)

smpte240m

\(\min\left(1, \max\left(0, \begin{cases} 1.11157219592173 L^{0.45} - 0.111572195921731 & \text{for}\: L \geq 0.022821585529445 \\4.0 L & \text{otherwise} \end{cases}\right)\right)\)

\(\begin{cases} 0.25 V & \text{for}\: V \leq 0.0912863421177801 \\0.790526217176035 \left(V + 0.111572195921731\right)^{2.22222222222222} & \text{otherwise} \end{cases}\)

smpte428, smpte428_1

\(\min\left(1, \max\left(0, 0.967042675317934 L^{0.384615384615385}\right)\right)\)

\(1.09104166666667 V^{2.6}\)

srgb

\(\min\left(1, \max\left(0, \begin{cases} 1.05501071894759 L^{0.416666666666667} - 0.0550107189475866 & \text{for}\: L \geq 0.00304128256012752 \\12.92 L & \text{otherwise} \end{cases}\right)\right)\)

\(\begin{cases} 0.0773993808049536 V & \text{for}\: V \leq 0.0392933706768475 \\0.879394017810642 \left(V + 0.0550107189475866\right)^{2.4} & \text{otherwise} \end{cases}\)

Details