W3C home > Mailing lists > Public > www-svg@w3.org > February 2011

Re: SVG masks and luminance calculations

From: Erik Dahlstrom <ed@opera.com>
Date: Thu, 03 Feb 2011 10:58:41 +0100
To: "Dirk Schulze" <vbs85@gmx.de>
Cc: www-svg@w3.org, "Robert Longson" <longsonr@gmail.com>
Message-ID: <op.vqbnb1d6geuyw5@localhost>
On Thu, 03 Feb 2011 10:39:39 +0100, Dirk Schulze <vbs85@gmx.de> wrote:

>
> Am 03.02.2011 um 09:37 schrieb Erik Dahlstrom:
>
>> On Thu, 03 Feb 2011 08:22:00 +0100, Robert Longson <longsonr@gmail.com>  
>> wrote:
>>
>>>> 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".
>>>
>>> Erik,
>>>
>>> Is that what Opera currently implements? If not what is it doing?
>>
>> Like I wrote in [1] my current thinking is that the linearRGB luminance  
>> calculation for the mask element is in conflict with the  
>> 'color-interpolation' property.
>>
>> Opera is currently doing the luminance calculation in sRGB-space.  
>> According to the mozilla bugreport comments (see link in [1]) that's  
>> also what e.g Photoshop does.
>
> Given the fact that there are still bug reports about a wrong behavior  
> on Firefox, it looks like the spec is a bit confusing here. I agree to  
> Eric that linearRGB as default looks a bit confusing since the default  
> of color-interpolation is sRGB. I guess the root of this phrasing is the  
> specification of SVG Filters. The masking text relies to  
> 'feColorMatrix'. And the default color space on filters is linearRGB[1].
> Both confused me at the time I startet working on implementing masks[2]  
> and filters. But filter has another property named  
> 'color-interpolation-filters'. And the default value is linearRGB for  
> this property. So even if I'm unsure why linearRGB was chosen, the  
> definition looks clear here. This is different on Masking. And it might  
> make sense to use sRGB as default.
> The most(unsure about Safari/Win) ports of WebKit use linearRGB as  
> default now, but it's no problem to change it back to sRGB. Note that  
> the masking tests on the test suite would need new results, or the tests  
> need to use  color-interpolation="linearRGB" explicitly.

I don't think that there are any tests in the testsuite where such a  
change would give a very different result visually.

It would make sense to include a test to clearly show the difference  
though. With gradients and with raster images with alpha.
/Erik

-- 
Erik Dahlstrom, Core Technology Developer, Opera Software
Co-Chair, W3C SVG Working Group
Personal blog: http://my.opera.com/macdev_ed
Received on Thursday, 3 February 2011 09:59:19 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:47 GMT