Color Gamut Converter
A code value only means a color once you know its gamut: the primaries and white point it was encoded against. This page converts RGB values between Rec.709 / sRGB, Display P3 and Rec.2020 in linear light, and tells you plainly when the color does not exist in the target gamut.
The math is a change of primaries, not a change of look: the values are decoded to linear light, carried through CIE XYZ with the D65 white point shared by all three spaces, and re-encoded in the target. A color inside the target gamut converts exactly; one outside it has no valid code, so every target channel is reported before clipping and the clipped codes are shown separately. A DCP or cinema P3 target uses a different white point and is not modeled here, and the page does not read ICC profiles or tag images. Nothing is stored and the page makes no network requests.
Primaries and white point
| Gamut | Red x, y | Green x, y | Blue x, y | White x, y |
|---|
Rec.709 and Display P3 share the D65 white point; Rec.2020 uses the same white with much wider primaries. Because the white point is common, the conversion needs no chromatic adaptation — only a 3×3 matrix built from these coordinates.
How the conversion works
A gamut is two things: the chromaticity of its red, green and blue primaries and the white point they add up to. Rec.709 (the HDTV gamut, also the sRGB gamut) and Display P3 both use D65 white; Rec.2020 uses the same white with primaries close to the spectral locus. The three spaces therefore differ only in their primaries, which makes the conversion a linear-algebra step.
- Decode. Each input code is divided by its full scale and passed through the selected encoding curve to give linear light. The curve matters: the sRGB curve, the BT.709 OETF and a pure 2.4 gamma produce different linear values from the same code.
- To XYZ. Linear RGB becomes CIE XYZ with a matrix whose columns are the primary XYZ vectors, scaled so that RGB 1, 1, 1 lands on D65 white with Y = 1. Those matrices are derived from the chromaticities above, not typed in, and reproduce the standard sRGB matrix and the BT.2087 BT.709-to-BT.2020 conversion matrix to the precision those references publish.
- To the target. The inverse target matrix turns XYZ into target linear RGB, and the same curve re-encodes it. Because the white point is shared, neutral grey stays neutral in every gamut.
- Out of gamut. A wide-gamut color can be more saturated than the target allows. Then one or more target channels fall below 0 or above 1. The page reports the unclipped channel percentages, marks which channels are out and by how much, and shows the clipped codes you would actually store. It does not gamut-map or pick a perceptually nearest color: that is a rendering intent decision for your color-managed application.
- Rounding. Codes are rounded to the nearest integer only for display; percent, linear and XYZ values are shown unrounded to four decimals. Inputs must be inside 0 to full scale, so the source is always a valid code in its own gamut.
This is a calculator for checking and converting values, not a color-management engine. It treats all three spaces as display-referred D65 RGB, ignores camera logs, HDR transfers, ICC profiles and cinema white, and assumes the source values really were encoded in the chosen gamut and curve. Use the HDR transfer function converter when you need PQ or HLG luminance.