Skip to tool
ecech.
🎨 Design & Color

Averaging the Channels Turns Red, Green and Blue Into the Same Grey

All three average to exactly 85. Weighted by luminance they are 54, 182 and 18 — which is roughly how the eye sees them.

Average

Rec.601

Rec.709

Linear light

Your colours, four ways

The coefficients

Advertisement

How the calculation works

Three very different colours, two methods average 85, 85, 85 — identical Rec.709 54, 182, 18 Green carries 3.36 times the brightness of red, and nearly ten times that of blue.

How to Use This Tool

Pick a colour, or paste several. All four methods are shown because the differences between them are the point.

Why averaging fails

The eye has far more sensitivity to green than to red, and very little to blue. Averaging the three channels ignores that entirely, so pure red, pure green and pure blue all come out at exactly 85 — the same grey for three colours nobody would confuse.

Weighting by luminance fixes it. The standard coefficients are:

  • Rec.709 — 0.2126 R + 0.7152 G + 0.0722 B. Matches the primaries used by sRGB and by every modern display, and is the right default.
  • Rec.601 — 0.299 R + 0.587 G + 0.114 B. Defined for older standard-definition video, and still what a surprising number of image libraries use.

Under Rec.709 the same three colours become 54.2, 182.4 and 18.4. Green is 3.36 times brighter than red, which is roughly how they appear.

The gamma problem

Here is the part most implementations skip. An sRGB value of 128 is not half the light of 255 — it is about 21.6%, because the values are gamma-encoded to give more precision to dark tones where the eye is more sensitive.

So applying luminance weights directly to sRGB numbers is arithmetic on encoded values rather than on light. Doing it properly means three steps: convert each channel to linear light, apply the weights there, then re-encode the result.

For pure red the two answers are far apart: 54.2 in gamma space and 127.1 done linearly. Both are used, and they are answers to different questions:

  • Linear light is physically correct. It is what you want for compositing, blending, resizing and anything where the maths must model actual photons.
  • Gamma-space weighting is what photographic and video convention produces, and it is what most people expect a black-and-white conversion to look like. Linear conversions of colourful images often look washed out and flat to viewers.
sRGB 128 is not half the light the number 128 of 255 — 50.2% the light 21.6% of white The encoding gives more precision to dark tones, where the eye needs it. Weighting encoded values is arithmetic on the wrong numbers — which is why linear conversion exists, and why it looks unfamiliar.
Both approaches are in wide use. The mistake is not knowing which one a tool is doing.

Greyscale is not desaturation

Two different operations that people use interchangeably:

  • Greyscale computes one brightness value and uses it for all three channels.
  • Desaturation in HSL sets saturation to zero, which takes the midpoint of the highest and lowest channel — giving 128 for all of pure red, green and blue, and losing luminance information just as badly as averaging.

The CSS filter: grayscale(1) uses a luminance matrix, so it does the right thing. The HSL-based desaturation in some design tools does not.

Checking a design in greyscale

Converting an interface to greyscale is the quickest test of whether it relies on colour alone. If a red error state and a green success state produce a similar grey, the distinction is invisible to a viewer with colour vision deficiency, and it stays invisible in print and on a failing display.

Use Rec.709 for that test, since it approximates how the colours actually appear. Two states that differ by less than about 20 in the result are too close to rely on.

Advertisement

Frequently Asked Questions

What is the correct formula for greyscale?
Weight by luminance rather than averaging. Rec.709 — 0.2126 R + 0.7152 G + 0.0722 B — matches the primaries of sRGB and modern displays. Averaging the three channels makes pure red, green and blue all come out at exactly 85.
What is the difference between Rec.601 and Rec.709?
The coefficients. Rec.601 uses 0.299, 0.587 and 0.114, defined for standard-definition video; Rec.709 uses 0.2126, 0.7152 and 0.0722, matching sRGB primaries. For pure red they give 76.2 and 54.2 — noticeably different.
Should I convert in linear light?
For compositing, blending and resizing, yes — that maths must model actual light. For a black-and-white rendering that looks the way people expect, gamma-space weighting is the photographic convention. Pure red is 127.1 linearly and 54.2 in gamma space, and neither is wrong.
Why is sRGB 128 not half the brightness?
Because sRGB is gamma-encoded to give more precision to dark tones where the eye is more sensitive. A value of 128 emits about 21.6% of the light of 255, so weighting encoded values directly is arithmetic on the wrong numbers.
Is desaturating the same as converting to greyscale?
No. Greyscale computes one brightness value from all three channels. HSL desaturation takes the midpoint of the highest and lowest channel, which gives 128 for pure red, green and blue alike and discards luminance the same way averaging does.
How do I check a design works without colour?
Convert it with Rec.709 and look at whether states that must be distinguished still are. If a red error and a green success land within about 20 of each other, the difference is invisible to viewers with colour vision deficiency and in print.

Related tools in Design & Color

Browse all Design & Color tools
A handwritten note reading ecech.com resting on the keyboard used to build the site.

Made by one person

ecech. is not a content farm. Every tool here is written and checked by hand, one at a time, by someone who wanted the tool to exist and could not find a version that showed its working.

No accounts and no sign-in, and nothing you type reaches a server — every calculation on this page runs inside your browser. The ads are served by Google and do set their own cookies, which is set out in full on the privacy page. More about the site.