SVG masks and luminance calculations

Hello masked avengers ;)

I'm wondering why SVG 1.1 overrides the color-interpolation property for  
mask elements, as reported here[2]. More specifically, the bit of the spec  
this concerns is [1]:

     A linear luminance value is computed from the color channel values.  
This
     can be done, for example, by first converting the original image color
     values (potentially in the sRGB color space) to the linear RGB color  
space
     (see Rendering properties). Then, using non-premultiplied linear RGB  
color
     values, apply the luminance-to-alpha coefficients (as defined in the
     ‘feColorMatrix’ filter primitive)...

I don't fully understand why masks need this kind of special treatment, if  
one wants a linearRGB colorspace why not just use  
color-interpolation="linearRGB" explicitly? The color-interpolation  
property has an initial value of 'sRGB', and it applies to container  
elements (including <mask>). To me this looks like a contradiction in the  
spec. For performance reasons I would like to propose that the default  
behaviour is changed so that it respects the 'color-interpolation'  
property, while maintaining the existing behaviour via  
"color-interpolation=linearRGB".

If anyone has the history of this that would be interesting to hear. I  
have already been through the thread here[3], but there were no mentions  
of the above.

Cheers
/Erik

[1] http://www.w3.org/TR/SVG/masking.html#MaskElement
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=630657
[3] http://lists.w3.org/Archives/Public/www-svg/2009Feb/0016.html

-- 
Erik Dahlstrom, Core Technology Developer, Opera Software
Co-Chair, W3C SVG Working Group
Personal blog: http://my.opera.com/macdev_ed

Received on Wednesday, 2 February 2011 14:38:06 UTC