W3C home > Mailing lists > Public > public-fx@w3.org > July to September 2011

luminanceToAlpha values in FEColorMatrix

From: Dean Jackson <dino@apple.com>
Date: Fri, 02 Sep 2011 11:10:53 +1000
Message-id: <CC141605-779D-44EC-9D61-EFE2591F1FB7@apple.com>
To: public-fx@w3.org, www-svg <www-svg@w3.org>
Get your acronym hats on.

A colleague has questioned the values used for luminanceToAlpha in FEColorMatrix. The specification (since SVG 1.0) has used:

  0.2125 red, 0.7154 green, 0.0721 blue

But where do these numbers come from? It turns out there are a few different specifications for this. The closest to what is specified is in Rec. ITU-R BT.709-5 [1], but it is slightly different:

  0.2126 red, 0.7152 green, 0.0722 blue

Yes, a minor difference, but it would be nice to reference an external specification. sRGB is based on Rec 709, so I guess this might be the definitive source. According to [2], sRGB uses the latter values.

Even then, I'm told that it is more common to use other luminance to alpha values. For example, ITU-R BT.601 (YIQ? NTSC? JPEG?) [3] uses:

  0.299 red, 0.587 green, 0.114 blue

And Flash + OpenGL use:

  0.3086 red, 0.6094 green, 0.0820 blue

Since sRGB is used throughout the SVG specification, and sRGB takes its values from Rec 709, and Rec 709 seems modern (it's designed for HDTV), and the values are really close to what is already specified, I suggest we formally link to Rec 709 and use its values (a very slight change to current implementations).

Note that these values are also used in other parts of FEColorMatrix, as well as other parts of the SVG specification (although it seems the spec doesn't always reference explicitly). For example:

- FEColorMatrix type="saturate" and type="huerotate"
- 'mask' property

Dean

[1] http://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.709-5-200204-I!!PDF-E.pdf
[2] http://en.wikipedia.org/wiki/SRGB
[3] http://en.wikipedia.org/wiki/YCbCr#ITU-R_BT.601_conversion
Received on Friday, 2 September 2011 01:11:40 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 2 September 2011 01:11:41 GMT