ISSUE-2335: Clarify feConvolveMatrix bias property [SVG 1.1 F2 Last Call]

ISSUE-2335: Clarify feConvolveMatrix bias property [SVG 1.1 F2  Last Call]

http://www.w3.org/Graphics/SVG/WG/track/issues/2335

Raised by: Erik Dahlström
On product: SVG 1.1 F2  Last Call

I would really like the bias property clarified in SVG 1.1 SE. The problem with the current explanation is that it seems to be contradictory (and if you take the most explicit explanation, frankly not that useful).
 
In the explanation of the property it is said to be intended to have (as one possibility) a gray zero response. However, in the basic convolution formula the bias is added directly to the premultiplied color values. If you follow this definition the bias property does not give you any effective control over the zero response! Depending on the alpha component a bias of 0.5 could be anything from out-of-range white to 0.5 gray.
 
We've discussed this problem before and the last post in that thread that I could find was by me (on Nabble, as my laptop, with a lot of my e-mails is being serviced) and summarized the progress as follows:
 
<quote>
For reference, the pseudo-code in the SVG  specification suggests
the following (preserveAlpha=false):
-------------------------------------
Option 1:
   aF = filtered alpha without bias
   cF = filtered (premultiplied) color without bias
   aR = aF + bias
   cR = cF + bias
-------------------------------------
 
I previously suggested:
-------------------------------------
Option 2:
   cR = cF + bias*aR
-------------------------------------
 
You seem to suggest:
-------------------------------------
Option 3:
   cR = cF + bias*(aR-bias)
-------------------------------------
I'm not sure what the advantage of this would be though. For example, if
you have a uniformly colored shape (opacity also uniform) and apply the
filter -1 1 (with bias=0.5) I would expect a response of
(0.25,0.25,0.25,0.5), and not (0,0,0,0.5).
 
Another option would be to do an explicit conversion from and to
premultiplied colors:
-------------------------------------
Option 4:
   cR = (cF/aF + bias)*aR
-------------------------------------
Conceptually this might be cleaner, but it does have the disadvantage of
needing a division. Specifically, what color should result if aF=0?
</quote>

Original mail:
http://www.w3.org/mid/4C21BDBC.3090800@hccnet.nl

Received on Wednesday, 23 June 2010 08:13:57 UTC