RGB Spaces Colorimetric Data
I present the following defined and precomputed data for each RGB color space.
This page is by Agatha Mallett (homepage). The theory of how to derive RGB matrices can be found here. Additional notes on sources and data are below. The important thing is that, barring any mistakes, all these numbers are exact to double-precision.
TL;DR Converting XYZ to sRGB
The most useful thing you can do with this data is convert from CIE XYZ to RGB. If you don't know what you're doing, that's probably sRGB.
See the main article for many more details, but basically, you:
- Convert a spectral power distribution (in units of spectral radiance) into absolute XYZ space by taking the dot-products (not integrals) with the three (1 nm versions of) the CIE XYZ 1931 2° standard observer functions, which are just tabulated data you can just download.
- Convert absolute XYZ to relative XYZ by multiplying by η.
- Left-multiply relative XYZ by the space's M-1 matrix to convert to linear RGB.
- Finally, do any encoding transform (e.g. gamma encoding) for the space.
For sRGB:
Compute the absolute XYZ value. ⎡X⎤ 830 nm ⎡̄x(λ)⎤ (Note: CIE 015 specifies that this is a sum, not an ⎢Y⎥ = Σ s(λ) ⎢ȳ(λ)⎥ Δλ integral, and that the dataset to use is the Δλ = 1 nm ⎣Z⎦abs λ=360 nm ⎣̄z(λ)⎦ one. Data s(λ) should be in spectral radiance.) Convert to relative XYZ. ⎡X⎤ ⎡X⎤ ⎢Y⎥ = 8.537524999999999 ⎢Y⎥ (Multiply by η value for sRGB) ⎣Z⎦rel ⎣Z⎦abs Convert to linear RGB. Note this matrix is M⁻¹; it's already inverted; you're welcome. ⎡R⎤ ⎡ 3.2404462546477406 -1.5371347618200821 -0.49853019302272933⎤ ⎡X⎤ ⎢G⎥ = ⎢-0.9692666062446794 1.8760119597883693 0.04155604221443006⎥ ⎢Y⎥ ⎣B⎦ℓRGB ⎣ 0.055643503564352756 -0.2040261797359601 1.0572265677227024 ⎦ ⎣Z⎦rel Gamma-encode to get sRGB. To be clear, you apply the `enc` function to each channel separately. ⎡R⎤ enc( ⎡R⎤ ) ⎧ 255 if v ≥ 1.0 ⎢G⎥ = enc( ⎢G⎥ ) enc(v) = ⎨ 255*12.92*v if v ≤ 0.0031308 ⎣B⎦sRGB enc( ⎣B⎦ℓRGB ) ⎩ 255*(1.055 val^(1.0/2.4) - 0.055) otherwise
Note: if you're using the data spectrum for the white-point itself (e.g. D65), you need to be aware that that is not in units of spectral radiance. It was normalized to some arbitrary value. Therefore, you cannot use it as s(λ) in the above! If you want to do this, you must first multiply the values by σ (for sRGB, σ=11084.41934789392), which will return an SPD in SI units at the space's white luminance.
Colorimetric Data Table
Columns:
- Color-Space: The name, links, and notes about the color space.
- White-Point - Reference: The reference SPD for the white-point. The white-point is usually the chromaticity of a CIE standard illuminant, but sometimes may be only of a CIE illuminant. Rarely, it is a pre-defined chromaticity directly, in which case it is given in the next column.
- White-Point - Chromaticity: The CIE 1931 xy chromaticity for the white-point. The z-component is also provided..
- White-Point - Scaling: (Lum, σ, η): Respectively, the RGB space's target luminance (in nits), the scaling of the reference SPD to convert it to real units, and the scaling to convert from absolute XYZ to relative XYZ.
- White-Point - Absolute XYZ: The CIE 1931 XYZ value of the reference spectrum scaled to have real units.
- White-Point - Normalized XYZ: The CIE 1931 XYZ value of the reference spectrum, normalized to Y=1.
- Primaries' Chromaticities: The CIE 1931 xy chromaticity (xyz provided) of the red, green, and blue primaries.
- M-1 (Normalized XYZ → RGB): The transformation matrix that converts from normalized XYZ space to the RGB space.
- M (RGB → Normalized XYZ): The transformation matrix that converts from the RGB space to normalized XYZ space.
Accuracy not guaranteed, page subject to change at any time. Please contact me (see links on homepage), for corrections or additions.
| Color-Space | White-Point | Primaries' Chromaticities | Matrices | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Reference | Chromaticity | Scaling: (Lum, σ, η) | Absolute XYZ | Normalized XYZ | R | G | B | M-1 (Normalized XYZ → RGB) | M (RGB → Normalized XYZ) | |
| Adobe RGB (1998) [1] | D65 | 0.31272687102656477 | 160.0 | 0.22265716554956688 | 0.950470558654283 | 0.64 | 0.21 | 0.15 | 2.0413657621150683 -0.5649454968342187 -0.34469384114836343 | 0.576731796112626 0.1855538404930999 0.18818492204855708 |
| Apple RGB | D65 | 0.31272687102656477 | ??? | N/A | 0.950470558654283 | 0.625 | 0.28 | 0.155 | 2.9515306569680746 -1.2894086677719054 -0.473843413014217 | 0.4497298473899065 0.31624840281282596 0.1844923084515505 |
| BestRGB [2][3] | D50 | 0.34568422232262525 | ??? | N/A | 0.964240837883783 | 0.734710465507832 | 0.21496142445710442 | 0.12999487967229903 | 1.7549551966024226 -0.4834852176621251 -0.2529476905455372 | 0.6327599424300101 0.20450534805234277 0.12697554740143013 |
| Beta RGB [4] | D50 | 0.34568422232262525 | ??? | N/A | 0.964240837883783 | 0.6888 | 0.1986 | 0.1265 | 1.6831353903038802 -0.42821298806711844 -0.23600564200581922 | 0.6712902170491151 0.1745799459975276 0.11837067483714034 |
| Bruce RGB [5] | D65 | 0.31272687102656477 | ??? | N/A | 0.950470558654283 | 0.64 | 0.28 | 0.15 | 2.7454611464778576 -1.135811238097162 -0.4350259464377835 | 0.46741713762640236 0.29445105501870916 0.18860236600917146 |
| CIE RGB [6][7] | E | 0.3333143807773521 | ??? | N/A | 1.000080035889628 | 0.7346900232582807 | 0.2736826753487811 | 0.1665346669372639 | 2.3634619417619147 -0.8958167862405376 -0.4676796705361663 | 0.490204212440407 0.3098806236482379 0.19999519980098315 |
| ColorMatch RGB | D50 | 0.34568422232262525 | ??? | N/A | 0.964240837883783 | 0.63 | 0.295 | 0.15 | 2.6420569141623558 -1.2233203105671813 -0.3929800178475029 | 0.5093882890297654 0.3208992332658685 0.13395331558814907 |
| DCI-P3 (Min Gamut) [8][9][10] | 0.3139814397505545 | 48.0 | 0.0628730932745358 | 0.8946343427644687 | 0.68 | 0.265 | 0.15 | 2.725367990343361 -1.0179932795788438 -0.44015898959085253 | 0.4451740690408129 0.27712566079607664 0.17233461292757915 | |
| Display P3 | D65 | 0.31272687102656477 | ??? | N/A | 0.950470558654283 | 0.68 | 0.265 | 0.15 | 2.4931760142341752 -0.9312637545793583 -0.4026589580510947 | 0.48663357539456065 0.2656630314594593 0.19817395180026304 |
| DonRGB4 [11] | D50 | 0.34568422232262525 | ??? | N/A | 0.964240837883783 | 0.696 | 0.215 | 0.13 | 1.7602891057319137 -0.48809176042255037 -0.25359805045552036 | 0.645808237607865 0.19334757262406196 0.12508502765185603 |
| ECI RGB v2 | D50 | 0.34568422232262525 | ??? | N/A | 0.964240837883783 | 0.67 | 0.21 | 0.14 | 1.782656278583064 -0.4969553308581943 -0.2689941699140685 | 0.6502427338133577 0.17807419929034182 0.13592390478008343 |
| Ekta Space PS5 | D50 | 0.34568422232262525 | ??? | N/A | 0.964240837883783 | 0.695 | 0.26 | 0.11 | 2.0042580210400773 -0.7304392626332076 -0.24499004067937002 | 0.593928081193343 0.27297430736779327 0.09733844932264672 |
| HDTV (HD-CIF) | D65 | 0.31272687102656477 | ??? | N/A | 0.950470558654283 | 0.64 | 0.3 | 0.15 | 3.2404462546477406 -1.5371347618200821 -0.49853019302272933 | 0.41245744558236713 0.357575865245516 0.18043724782639986 |
| M.A.C. | D65 | 0.31272687102656477 | ??? | N/A | 0.950470558654283 | 0.67 | 0.21 | 0.14 | 1.9708347408378295 -0.549414288366556 -0.29738938544611754 | 0.588156514605899 0.1791315567830031 0.1831824872653808 |
| NTSC-FCC | C | 0.310089784498196 | ??? | N/A | 0.9806169788349289 | 0.67 | 0.21 | 0.14 | 1.9101298560238589 -0.5324914432393878 -0.2882293133130631 | 0.6068484236188597 0.1735249491622592 0.20024360605381003 |
| NTSC-J [12][13] | D93 | 0.283140310338486 | ??? | N/A | 0.9531697120926225 | 0.63 | 0.31 | 0.155 | 4.208210888348164 -2.0882485518339178 -0.6530261794394725 | 0.32785561766182303 0.3683632121738962 0.2569508822569032 |
| NTSC, MUSE | D65 | 0.31272687102656477 | ??? | N/A | 0.950470558654283 | 0.63 | 0.31 | 0.155 | 3.505386700609879 -1.7394847585786744 -0.5439625877342246 | 0.39359012225685513 0.36524942132870863 0.1916310150687192 |
| PAL / SECAM | D65 | 0.31272687102656477 | ??? | N/A | 0.950470558654283 | 0.64 | 0.29 | 0.15 | 3.0628900410173245 -1.3931759151054413 -0.47575057119781294 | 0.43062002921388537 0.3415417093833163 0.1783088200570813 |
| PAL-M | C | 0.310089784498196 | ??? | N/A | 0.9806169788349289 | 0.67 | 0.21 | 0.14 | 1.9101298560238589 -0.5324914432393878 -0.2882293133130631 | 0.6068484236188597 0.1735249491622592 0.20024360605381003 |
| ProPhoto / ROMM [14] | D50 | 0.34568422232262525 | ??? | N/A | 0.964240837883783 | 0.734699 | 0.159597 | 0.036598 | 1.3458878267624148 -0.25559125739413247 -0.051105698036871774 | 0.797706810310927 0.13518540007788032 0.03134862749497562 |
| Russell RGB | D55 | 0.33243977703264577 | ??? | N/A | 0.95683022916123 | 0.69 | 0.18 | 0.1 | 1.5869131539993353 -0.35978787736254514 -0.1721540430144121 | 0.7016217794292249 0.15541232637623156 0.09979612335577351 |
| SGI [15] | D65 | 0.31272687102656477 | ??? | N/A | 0.950470558654283 | 0.625 | 0.28 | 0.155 | 2.9515306569680746 -1.2894086677719054 -0.473843413014217 | 0.4497298473899065 0.31624840281282596 0.1844923084515505 |
| scRGB | D65 | 0.31272687102656477 | 80.0 | 0.11132858277478344 | 0.950470558654283 | 0.64 | 0.3 | 0.15 | 3.2404462546477406 -1.5371347618200821 -0.49853019302272933 | 0.41245744558236713 0.357575865245516 0.18043724782639986 |
| sRGB | D65 | 0.31272687102656477 | 80.0 | 0.11132858277478344 | 0.950470558654283 | 0.64 | 0.3 | 0.15 | 3.2404462546477406 -1.5371347618200821 -0.49853019302272933 | 0.41245744558236713 0.357575865245516 0.18043724782639986 |
| SMPTE-240M, SMPTE-C | D65 | 0.31272687102656477 | ??? | N/A | 0.950470558654283 | 0.63 | 0.31 | 0.155 | 3.505386700609879 -1.7394847585786744 -0.5439625877342246 | 0.39359012225685513 0.36524942132870863 0.1916310150687192 |
| UHDTV | D65 | 0.31272687102656477 | ??? | N/A | 0.950470558654283 | 0.708 | 0.17 | 0.131 | 1.7165084742369088 -0.3556412150986606 -0.2533452177770312 | 0.637011006188227 0.1446149706534515 0.1688445818126044 |
| Wide Gamut [16][17] | D50 | 0.34568422232262525 | ??? | N/A | 0.964240837883783 | 0.7346900232582807 | 0.11416071960667966 | 0.1566409325773071 | 1.4593613408175363 -0.18194500055000798 -0.2729646425797244 | 0.7175363176525349 0.1000814406190751 0.14662307961217302 |
Data Notes
- This data is based on various online resources, but especially Wikipedia's list and Bruce Lindbloom's list. Sources are gratefully acknowledged.
- The entire end-to-end calculation of derived results is computed using arbitrary-precision arithmetic and rounded to the nearest
double-precision value[18][19]. Every number is written with the minimum number of digits to prevent any precision loss for that particular number. - As per CIE 015:2004 §7.1, for the standard observer I use the official 1 nm dataset.
- For standard illuminants D50 and D65, I use the official 1 nm datasets (1 and 2)[20].
- For illuminants C and D55, I use the official 5 nm datasets (1, 2). CIE does not maintain these as standards, so 5 nm is the highest official source provided. I interpolate these linearly to 1 nm.
- In keeping with the recommendations of CIE 015, I use the modern 1 nm versions of CIE 1924 V(λ) and CIE 1931 ȳ(λ), which are numerically identical (unlike the 5 nm originals). Newer datasets have been defined, but using them in the context of RGB spaces defined for the older standards would make a bogus result.
- For a fair few spaces, I didn't find the reference luminance of the white-point. This means some information cannot be calculated (represented as "???").