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) and the Commission Internationale de l’Eclairage.

PRIMARIES

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

name

red

green

blue

white

adobe

x=0.64, y=0.33

x=0.21, y=0.71

x=0.15, y=0.06

x=0.31272, y=0.32903

bt2020

x=0.708, y=0.292

x=0.170, y=0.797

x=0.131, y=0.046

x=0.31272, y=0.32903

bt470bg

x=0.64, y=0.33

x=0.29, y=0.60

x=0.15, y=0.06

x=0.31272, y=0.32903

bt470m

x=0.67, y=0.33

x=0.21, y=0.71

x=0.14, y=0.08

x=0.31006, y=0.31616

bt601

x=0.64, y=0.33

x=0.29, y=0.60

x=0.15, y=0.06

x=0.31272, y=0.32903

bt709

x=0.64, y=0.33

x=0.3, y=0.6

x=0.15, y=0.06

x=0.31272, y=0.32903

film

x=0.681, y=0.319

x=0.243, y=0.692

x=0.145, y=0.049

x=0.31006, y=0.31616

jedec-p22, ebu3213

x=0.64, y=0.33

x=0.29, y=0.6

x=0.15, y=0.06

x=0.31272, y=0.32903

ntsc

x=0.630, y=0.340

x=0.310, y=0.595

x=0.155, y=0.070

x=0.31272, y=0.32903

pal

x=0.64, y=0.33

x=0.29, y=0.60

x=0.15, y=0.06

x=0.31272, y=0.32903

smpte170m

x=0.630, y=0.340

x=0.310, y=0.595

x=0.155, y=0.070

x=0.31272, y=0.32903

smpte240m

x=0.630, y=0.340

x=0.310, y=0.595

x=0.155, y=0.070

x=0.31272, y=0.32903

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.31272, y=0.32903

srgb

x=0.64, y=0.33

x=0.3, y=0.6

x=0.15, y=0.06

x=0.31272, y=0.32903

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

\(\begin{cases} L & \text{for}\: L \leq 0 \\0.5477225575051661134569697828008021339 \sqrt{L} & \text{for}\: L \leq 0.8333333333333333333333333333333333333 \\0.1788327726569497656275213115686889965 \log{\left(1.2 L - 0.284668909372200937489914753725244014 \right)} + 0.5599107277627164298015656640000824769 & \text{otherwise} \end{cases}\)

\(\begin{cases} V & \text{for}\: V \leq 0 \\3.333333333333333333333333333333333333 V^{2} & \text{for}\: V \leq 0.5 \\0.03639807283723238365611145995727761882 e^{5.591816226650323579784914000481150328 V} + 0.2372240911435007812415956281043700117 & \text{otherwise} \end{cases}\)

bt1361e, bt1361

\(\begin{cases} 4.5 L & \text{for}\: L \leq 0.01805396851080780733586959258468773494 \\1.099296826809442940347282759215782542 L^{0.45} - 0.099296826809442940347282759215782542 & \text{otherwise} \end{cases}\)

\(\begin{cases} 0.2222222222222222222222222222222222222 V & \text{for}\: V \leq 0.08124285829863513301141316663109480723 \\0.8102767739639528769712002962157077857 \left(V + 0.099296826809442940347282759215782542\right)^{2.222222222222222222222222222222222222} & \text{otherwise} \end{cases}\)

bt2020

\(\begin{cases} 4.5 L & \text{for}\: L \leq 0.01805396851080780733586959258468773494 \\1.099296826809442940347282759215782542 L^{0.45} - 0.099296826809442940347282759215782542 & \text{otherwise} \end{cases}\)

\(\begin{cases} 0.2222222222222222222222222222222222222 V & \text{for}\: V \leq 0.08124285829863513301141316663109480723 \\0.8102767739639528769712002962157077857 \left(V + 0.099296826809442940347282759215782542\right)^{2.222222222222222222222222222222222222} & \text{otherwise} \end{cases}\)

bt2020-10, bt2020_10bit

\(\begin{cases} 4.5 L & \text{for}\: L \leq 0.01805396851080780733586959258468773494 \\1.099296826809442940347282759215782542 L^{0.45} - 0.099296826809442940347282759215782542 & \text{otherwise} \end{cases}\)

\(\begin{cases} 0.2222222222222222222222222222222222222 V & \text{for}\: V \leq 0.08124285829863513301141316663109480723 \\0.8102767739639528769712002962157077857 \left(V + 0.099296826809442940347282759215782542\right)^{2.222222222222222222222222222222222222} & \text{otherwise} \end{cases}\)

bt2020-12, bt2020_12bit

\(\begin{cases} 4.5 L & \text{for}\: L \leq 0.01805396851080780733586959258468773494 \\1.099296826809442940347282759215782542 L^{0.45} - 0.099296826809442940347282759215782542 & \text{otherwise} \end{cases}\)

\(\begin{cases} 0.2222222222222222222222222222222222222 V & \text{for}\: V \leq 0.08124285829863513301141316663109480723 \\0.8102767739639528769712002962157077857 \left(V + 0.099296826809442940347282759215782542\right)^{2.222222222222222222222222222222222222} & \text{otherwise} \end{cases}\)

bt470bg

\(\begin{cases} L & \text{for}\: L \leq 0 \\L^{0.3571428571428571428571428571428571429} & \text{otherwise} \end{cases}\)

\(\begin{cases} V & \text{for}\: V \leq 0 \\V^{2.8} & \text{otherwise} \end{cases}\)

bt470m

\(\begin{cases} L & \text{for}\: L \leq 0 \\L^{0.4545454545454545454545454545454545455} & \text{otherwise} \end{cases}\)

\(\begin{cases} V & \text{for}\: V \leq 0 \\V^{2.2} & \text{otherwise} \end{cases}\)

bt601

\(\begin{cases} 4.5 L & \text{for}\: L \leq 0.01805396851080780733586959258468773494 \\1.099296826809442940347282759215782542 L^{0.45} - 0.099296826809442940347282759215782542 & \text{otherwise} \end{cases}\)

\(\begin{cases} 0.2222222222222222222222222222222222222 V & \text{for}\: V \leq 0.08124285829863513301141316663109480723 \\0.8102767739639528769712002962157077857 \left(V + 0.099296826809442940347282759215782542\right)^{2.222222222222222222222222222222222222} & \text{otherwise} \end{cases}\)

bt709

\(\begin{cases} 4.5 L & \text{for}\: L \leq 0.01805396851080780733586959258468773494 \\1.099296826809442940347282759215782542 L^{0.45} - 0.099296826809442940347282759215782542 & \text{otherwise} \end{cases}\)

\(\begin{cases} 0.2222222222222222222222222222222222222 V & \text{for}\: V \leq 0.08124285829863513301141316663109480723 \\0.8102767739639528769712002962157077857 \left(V + 0.099296826809442940347282759215782542\right)^{2.222222222222222222222222222222222222} & \text{otherwise} \end{cases}\)

gamma22

\(\begin{cases} L & \text{for}\: L \leq 0 \\L^{0.4545454545454545454545454545454545455} & \text{otherwise} \end{cases}\)

\(\begin{cases} V & \text{for}\: V \leq 0 \\V^{2.2} & \text{otherwise} \end{cases}\)

gamma26

\(\begin{cases} L & \text{for}\: L \leq 0 \\L^{0.3846153846153846153846153846153846154} & \text{otherwise} \end{cases}\)

\(\begin{cases} V & \text{for}\: V \leq 0 \\V^{2.6} & \text{otherwise} \end{cases}\)

gamma28

\(\begin{cases} L & \text{for}\: L \leq 0 \\L^{0.3571428571428571428571428571428571429} & \text{otherwise} \end{cases}\)

\(\begin{cases} V & \text{for}\: V \leq 0 \\V^{2.8} & \text{otherwise} \end{cases}\)

iec61966-2-1, iec61966_2_1

\(\begin{cases} 12.92 L & \text{for}\: L \leq 0.003041282560127520854162833433376268246 \\1.05501071894758659721009733114290994 L^{0.4166666666666666666666666666666666667} - 0.05501071894758659721009733114290994 & \text{otherwise} \end{cases}\)

\(\begin{cases} 0.07739938080495356037151702786377708978 V & \text{for}\: V \leq 0.03929337067684756943578380795922138574 \\0.879394017810642054417581217980975085 \left(V + 0.05501071894758659721009733114290994\right)^{2.4} & \text{otherwise} \end{cases}\)

iec61966-2-4, iec61966_2_4

\(\left(\begin{cases} 4.5 \left|{L}\right| & \text{for}\: \left|{L}\right| \leq 0.01805396851080780733586959258468773494 \\1.099296826809442940347282759215782542 \left|{L}\right|^{0.45} - 0.099296826809442940347282759215782542 & \text{otherwise} \end{cases}\right) \operatorname{sign}{\left(L \right)}\)

\(\left(\begin{cases} 0.2222222222222222222222222222222222222 \left|{V}\right| & \text{for}\: \left|{V}\right| \leq 0.08124285829863513301141316663109480723 \\0.8102767739639528769712002962157077857 \left(\left|{V}\right| + 0.099296826809442940347282759215782542\right)^{2.222222222222222222222222222222222222} & \text{otherwise} \end{cases}\right) \operatorname{sign}{\left(V \right)}\)

linear

\(L\)

\(V\)

log100, log

\(\begin{cases} 0.00001525902189669642175936522468909742885 L & \text{for}\: L \leq 0.01000000702704667750197159799752265256 \\\frac{\log{\left(L \right)}}{2 \log{\left(10 \right)}} + 1 & \text{otherwise} \end{cases}\)

\(\begin{cases} 65535.0 V & \text{for}\: V \leq 0.0000001525903261928233387040756541927619219 \\10^{2 V - 2} & \text{otherwise} \end{cases}\)

log316, log_sqrt

\(\begin{cases} 0.00001525902189669642175936522468909742885 L & \text{for}\: L \leq 0.003162278538548654136151340181558209886 \\\frac{0.4 \log{\left(L \right)}}{\log{\left(10 \right)}} + 1 & \text{otherwise} \end{cases}\)

\(\begin{cases} 65535.0 V & \text{for}\: V \leq 0.00000004825327746316707310828321021680338575 \\10^{2.5 V - 2.5} & \text{otherwise} \end{cases}\)

smpte170m

\(\begin{cases} 4.5 L & \text{for}\: L \leq 0.01805396851080780733586959258468773494 \\1.099296826809442940347282759215782542 L^{0.45} - 0.099296826809442940347282759215782542 & \text{otherwise} \end{cases}\)

\(\begin{cases} 0.2222222222222222222222222222222222222 V & \text{for}\: V \leq 0.08124285829863513301141316663109480723 \\0.8102767739639528769712002962157077857 \left(V + 0.099296826809442940347282759215782542\right)^{2.222222222222222222222222222222222222} & \text{otherwise} \end{cases}\)

smpte2084

\(\begin{cases} L & \text{for}\: L \leq 0 \\\left(\frac{9.051985229687164687805367745809156301 L^{0.1593017578125} + 0.8359375}{8.973207073937711534699726335671571434 L^{0.1593017578125} + 1}\right)^{78.84375} & \text{otherwise} \end{cases}\)

\(\begin{cases} V & \text{for}\: V \leq 0 \\100.0 \left(\frac{0.8359375 - V^{0.01268331351565596512088783194609591756}}{18.6875 V^{0.01268331351565596512088783194609591756} - 18.8515625}\right)^{6.277394636015325670498084291187739464} & \text{otherwise} \end{cases}\)

smpte240m

\(\begin{cases} 4.0 L & \text{for}\: L \leq 0.02282158552944502220543059839744417796 \\1.111572195921731219670994036609727092 L^{0.45} - 0.111572195921731219670994036609727092 & \text{otherwise} \end{cases}\)

\(\begin{cases} 0.25 V & \text{for}\: V \leq 0.09128634211778008882172239358977671184 \\0.790526217176035190857986080494319491 \left(V + 0.111572195921731219670994036609727092\right)^{2.222222222222222222222222222222222222} & \text{otherwise} \end{cases}\)

smpte428, smpte428_1

\(\begin{cases} L & \text{for}\: L \leq 0 \\0.9670426753179335417464789663626881155 L^{0.3846153846153846153846153846153846154} & \text{otherwise} \end{cases}\)

\(\begin{cases} V & \text{for}\: V \leq 0 \\1.0910416666666666666666666666666667 V^{2.6} & \text{otherwise} \end{cases}\)

smpte431

\(\begin{cases} L & \text{for}\: L \leq 0 \\L^{0.3846153846153846153846153846153846154} & \text{otherwise} \end{cases}\)

\(\begin{cases} V & \text{for}\: V \leq 0 \\V^{2.6} & \text{otherwise} \end{cases}\)

srgb

\(\begin{cases} 12.92 L & \text{for}\: L \leq 0.003041282560127520854162833433376268246 \\1.05501071894758659721009733114290994 L^{0.4166666666666666666666666666666666667} - 0.05501071894758659721009733114290994 & \text{otherwise} \end{cases}\)

\(\begin{cases} 0.07739938080495356037151702786377708978 V & \text{for}\: V \leq 0.03929337067684756943578380795922138574 \\0.879394017810642054417581217980975085 \left(V + 0.05501071894758659721009733114290994\right)^{2.4} & \text{otherwise} \end{cases}\)

Details