ISSUE-2335: Last Call Comment: Clarify feConvolveMatrix bias property
Last Call Comment: Clarify feConvolveMatrix bias property
- State:
- OPEN
- Product:
- SVG 1.1 F2 Last Call
- Raised by:
- Erik Dahlström
- Opened on:
- 2010-06-23
- Description:
- 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 - Related Actions Items:
ACTION-2812 on Erik Dahlström to Find the test case, commit it and make some proposed wording - due 2010-07-13, closedACTION-2900 on Anthony Grasso to Investigate support for bias - due 2010-11-12, closedACTION-2916 on Anthony Grasso to Update the feConvolveMatrix test to include transparent image and upate the spec to clarify the algorithm - due 2010-12-09, closed- Related emails:
- SVG/profiles/1.1F2/DoC disco.xsl,1.4,1.5 dump.html,1.3,1.4 (from cvsmail@w3.org on 2011-05-04)
- FW: ISSUE-2335: Clarify feConvolveMatrix bias property [SVG 1.1 F2 Last Call] (from Anthony.Grasso@cisra.canon.com.au on 2011-02-27)
- SVG/profiles/1.1F2/master filters.html,1.40,1.41 (from cvsmail@w3.org on 2010-12-21)
- RE: ISSUE-2335: Clarify feConvolveMatrix bias property [SVG 1.1 F2 Last Call] (from Anthony.Grasso@cisra.canon.com.au on 2010-12-10)
- Re: {minutes} 9 December 2010 SVG WG telcon (from chris@w3.org on 2010-12-10)
- SVG/profiles/1.1F2/master filters.html,1.39,1.40 refs.html,1.30,1.31 (from cvsmail@w3.org on 2010-12-09)
- Re: [ISSUE-2335] feConvolveMatrix bias property in SVG 1.1 SE (from th.v.d.gronde@hccnet.nl on 2010-12-02)
- ACTION-2900: Investigate support for bias - ISSUE-2335: Clarify feConvolveMatrix bias property [SVG 1.1 F2 Last Call] (from Anthony.Grasso@cisra.canon.com.au on 2010-12-02)
- RE: [ISSUE-2335] feConvolveMatrix bias property in SVG 1.1 SE (from Anthony.Grasso@cisra.canon.com.au on 2010-12-02)
- status update (from cam@mcc.id.au on 2010-11-25)
- Agenda Nov 18 2010 SVG WG telcon (from ed@opera.com on 2010-11-17)
- Re: [ISSUE-2335] feConvolveMatrix bias property in SVG 1.1 SE (from th.v.d.gronde@hccnet.nl on 2010-11-10)
- [ISSUE-2335] feConvolveMatrix bias property in SVG 1.1 SE (from Anthony.Grasso@cisra.canon.com.au on 2010-11-10)
- Minutes, Lyon TPAC f2f 5 Nov 2010 (from chris@w3.org on 2010-11-05)
- Minutes, 14 Sept 2010 SVG WG telcon (from chris@w3.org on 2010-09-14)
- Minutes, Paris F2F day 4 (September 8, 2010) (from anthony.grasso@cisra.canon.com.au on 2010-09-09)
- Minutes Paris F2F day 1 (September 3, 2010) (from anthony.grasso@cisra.canon.com.au on 2010-09-04)
- SVG/profiles/1.1F2/DoC getxml.html,NONE,1.1 disco.xsl,1.3,1.4 dump.html,1.2,1.3 dump.xml,1.1,NONE (from cvsmail@w3.org on 2010-08-02)
- SVG/profiles/1.1F2/DoC disco.xsl,1.2,1.3 dump.html,1.1,1.2 (from cvsmail@w3.org on 2010-07-29)
- Minutes July 6 2010 SVG WG telcon (from anthony.grasso@cisra.canon.com.au on 2010-07-07)
- Re: feConvolveMatrix bias property in SVG 1.1 SE (from ed@opera.com on 2010-06-23)
- ISSUE-2335: Clarify feConvolveMatrix bias property [SVG 1.1 F2 Last Call] (from sysbot+tracker@w3.org on 2010-06-23)
Related notes:
Jasper writes: "For me the main use case is to apply a filter which could have both positive and negative results (read: laplacian or discretized derivative) and wanting to shift zero to 0.5. In this case I'd pretty much always want to preserve alpha, I think."
Erik Dahlström, 14 Sep 2010, 19:44:27ACTION: Accept
Anthony Grasso, 10 Dec 2010, 04:47:03CHANGE-TYPE: Editorial
Anthony Grasso, 10 Dec 2010, 04:47:31RESOLUTION: Updated wording for bias attribute and clarify the convolve matrix formula. Add a new test for this case.
Anthony Grasso, 10 Dec 2010, 04:49:00COMMENTER-RESPONSE: Accept
Anthony Grasso, 21 Feb 2011, 07:02:02Display change log