Skip to content
Glossary · Colour and colour management

XYZ and xyY

Dutch: XYZ en xyY

In short

XYZ describes a colour with three numbers: X, Y and Z. They come from measuring light with a standard observer and do not depend on a screen or a printer. That makes XYZ the shared language in which measuring instruments, colour profiles and other colour spaces talk to each other.

From light and observer to XYZ and xyYLight, object,standard observerX, Y, ZY is the brightnessx, y and Ycolour apart from brightness1 · measurement2 · XYZ3 · xyYx = X / (X+Y+Z) y = Y / (X+Y+Z)
XYZ is an intermediate step: the measurement gives X, Y and Z, and from those x, y and Y, the colour apart from brightness.

Why this exists

Colour is the interplay of a light source, an object and an observer. A screen, a printer and an instrument each describe colour in their own way: RGB numbers, CMYK percentages, spectra. To compare them you need a measure that belongs to none of those devices. The CIE defined that measure in 1931 as the colour space CIE 1931 XYZ.

The three numbers come from the colour matching functions of the standard observer. Y is the luminance, the brightness. X and Z carry the rest of the colour information; Z roughly follows blue. The standard observer looks at a patch of 2 degrees. In 1964 a variant of 10 degrees was added for larger patches. It is the same viewing angle you write as ‘2 degrees’ or ‘10 degrees’ in a colour specification.

Where you meet it

You rarely see XYZ, but it works under the hood everywhere. The profile connection space (PCS) of ICC profiles is closely based on CIE XYZ. Every device profile therefore translates to XYZ and back. Lab, the colour value you read in a colour guide and on a measurement report, is calculated from XYZ. And a conversion from RGB to another space goes through XYZ.

If you do the maths yourself, for example in a script that processes measurements, you almost always start with XYZ.

How it works

From X, Y and Z you make two numbers that describe only the colour itself and not the brightness. Divide X and Y each by the sum X + Y + Z. The results are called x and y, the chromaticity. Together with Y they form xyY: the same colour, written down differently.

Plot x and y in a plane and you get the chromaticity diagram with its well-known horseshoe shape. The pure spectral colours lie on the curved edge, the purples on the straight edge and less saturated colours towards the middle. Mixing two colours gives a point on the line between them. Equal distances in this diagram do not match equal perceived differences. That is why Lab was developed.

Note. XYZ and xyY are not RGB. The numbers have no device behind them, and an X of 0.4 says nothing about ‘how much red’. Watch the white point too: XYZ values belong to a reference white. If you want XYZ for another white point, you apply a chromatic adaptation.
About the name. The term for the three numbers is tristimulus values (Wikipedia, CIE 1931 color space). In Dutch texts you also just see ‘XYZ-waarden’; the Dutch page uses that name. The English term is listed as a search term.

Technical

From XYZ to xyY and back

x = X / (X + Y + Z)
y = Y / (X + Y + Z)
Y = Y

X = x * Y / y
Z = (1 - x - y) * Y / y

For black, X = Y = Z = 0 and you divide by zero. Lindbloom suggests using the x and y of the reference white then. If y is zero in the reverse conversion, you can set X = Y = Z = 0. Y is usually between 0 and 1, or between 0 and 100. X and Z get the same scale as Y. verified

From RGB to XYZ

Two steps. First you make the RGB values linear with the inverse companding of the RGB space, channel by channel, with values between 0 and 1. For sRGB: if V is less than or equal to 0.04045, then v = V / 12.92; otherwise v = ((V + 0.055) / 1.055)2.4. Then you multiply (r, g, b) by the 3x3 matrix of that RGB space. The matrix follows from the primaries and the white point of the space. The XYZ values belong to the reference white of that RGB space. verified

If you work with 0 to 255, divide each value by 255 first. Some people replace the sRGB function with a plain gamma of 2.2. That is a simplification (Lindbloom).

Sources

  • Bruce Lindbloom, brucelindbloom.com (eigen archiefkopie), pages XYZ to xyY, xyY to XYZ and RGB to XYZ (consulted 2026-10-20). Formulas in own notation; the texts are not copied.
  • Wikipedia, CIE 1931 color space (consulted 2026-10-20): XYZ as luminance and colour information, 2 and 10 degrees, chromaticity diagram.
  • ArgyllCMS documentation, Graeme Gill, A Concise Introduction to Color Management and ICC profiles (consulted 2026-10-20): PCS closely based on CIE XYZ.
  • A Better Brand Color Guide, tutorial v1.2.2, part A.1: colour as interplay of light, object and observer.

Last updated · checked by GrafiStore

Back to the glossary

Never miss an update?

Get the latest tips on workflow automation straight to your inbox.

By subscribing you agree to our privacy policy.