W3C home > Mailing lists > Public > www-svg@w3.org > July 2002

Re: Error in the grayscale matrix for feColorMatrix

From: Jonathan Watt <jonathan@jwatt.net>
Date: Wed, 03 Jul 2002 18:18:13 +0100
Message-ID: <3D2331D5.7080101@jwatt.net>
To: Thomas E Deweese <thomas.deweese@kodak.com>
CC: www-svg <www-svg@w3.org>

Thomas E Deweese wrote:

>>>>>>"JW" == Jonathan Watt <jonathan@jwatt.net> writes:
>>>>>>            
>>>>>>
>
>JW> The example in section 15.10 demonstrates a filter that is
>JW> supposed to do a conversion to grayscale, however the matrix given
>JW> is incorrect. For feColorMatrix the value A' is obtained from:
>
>    Where do you read that it is supposed to do a conversion to
>grayscale?  It is an _EXAMPLE_ of using the matrix form of feMatrix.
>
As it doesn't say on the filter or the text element that it is applied 
to I maybe should have pointed it out. It is the doc's desc that states 
that it is supposed to be a grayscale filter.

>JW> I would suggest that for a grayscale filter the alpha values of
>JW> each pixel should be left as it is (and certainly should not rely
>JW> on the R, G and B values of the pixel). Therefore the values a30,
>JW> a31 and a32 should be '0' and a33 should be '1'. The feColorMatrix
>JW> would then change [...] to:
>
>JW> <feColorMatrix type="matrix" in="SourceGraphic"
>JW>       values=".33 .33 .33 0 0
>JW>               .33 .33 .33 0 0
>JW>               .33 .33 .33 0 0
>JW>                0   0   0  1 0"/>
>
>    Well if you really want to convert an RGB image to gray scale you
>should use a matrix that looks like:
>
>
><feColorMatrix type="matrix" in="SourceGraphic"
>      values=".213 .715 .072 0 0
>              .213 .715 .072 0 0
>              .213 .715 .072 0 0
>               0   0    0    1 0"/>
>
>    To account for the visual weighting of the RGB components that
>occurs in the eye (very sensitive to green very insensitive to blue).
>The above matrix happens to be exactly what you get with:
>
>    <feColorMatrix type="saturate" values="0" in="SourceGraphic"/>
>  
>
Good point about the visual weighting. I had forgotten about that so 
thanks for the reminder.

>    Given that the issue is with an example, and the example does not
>purport to do a grayscale conversion I think we are OK here.
>
>    What do you think?
>  
>
I think that it does, let me know if you still disagree after reading 
the desc though.

Jonathan.
Received on Wednesday, 3 July 2002 13:18:15 GMT

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