Re: [Inkscape-devel] The bias property for feConvolveMatrix
Erik Dahlstrom wrote:
Sure thing, see attachment (screencapture). I'd still recommend installing Opera 10 for future comparisons, http://my.opera.com/desktopteam for the latest releases. Couldn't get the Adobe plugin to cooperate unfortunately, maybe I need a reboot.
Thanks! Seems like it also does not support the bias property though...
(Note that I changed the file a bit to make it easier to spot differences in implementation.)
Right. It would be nice if we could see a rendered result from Inkscape too.
Sure, I've attached an image. Note that Inkscape has some issues with the edges, but that's a different problem.
I've also included an image showing how Batik renders the file if I remove the bias attributes, hence my guess that Opera does not support the bias attribute.
On Thu, 14 May 2009 09:45:13 +0200, Jasper van de Gronde <th.v.d.gronde@...528...> wrote:
Erik Dahlstrom wrote:
Sure thing, see attachment (screencapture). I'd still recommend installing Opera 10 for future comparisons, http://my.opera.com/desktopteam for the latest releases. Couldn't get the Adobe plugin to cooperate unfortunately, maybe I need a reboot.
Thanks! Seems like it also does not support the bias property though...
Here's what Opera 10 does wrt to @bias (it is applied):
- After applying the @kernelMatrix and @divisor the number in @bias will be added to each channel - If @preserveAlpha is "true" then the alphachannel will not get any bias added.
It's agreed that this is probably not what one wants. Considering that @bias is probably not that widely used at the moment we should try to make it clear in the spec and to make the bias useful.
How about changing the spec to say something like the following for the application of @bias:
[[ To apply bias on a pixel follow these steps: 1. For each color channel (RGB) let the 'actual bias value' be the bias value multiplied by (ResultAlpha(X,Y)-bias). After applying the kernelMatrix and divisor, add the 'actual bias value' to each component (RGB). 2. For the alpha channel, unless preserveAlpha is 'true', add the [unmodified] bias value. ]]
Cheers /Erik
Erik Dahlström wrote:
... Here's what Opera 10 does wrt to @bias (it is applied):
- After applying the @kernelMatrix and @divisor the number in @bias will be added to each channel
- If @preserveAlpha is "true" then the alphachannel will not get any bias added.
That's strange, I've attached inkscape's output when I change it to do that (which mostly seems to agree with what I computed manually).
It's agreed that this is probably not what one wants. Considering that @bias is probably not that widely used at the moment we should try to make it clear in the spec and to make the bias useful.
How about changing the spec to say something like the following for the application of @bias:
[[ To apply bias on a pixel follow these steps:
- For each color channel (RGB) let the 'actual bias value' be the bias value multiplied by (ResultAlpha(X,Y)-bias). After applying the kernelMatrix and divisor, add the 'actual bias value' to each component (RGB).
- For the alpha channel, unless preserveAlpha is 'true', add the [unmodified] bias value.
]]
Why use (ResultAlpha(X,Y)-bias)? If you just use ResultAlpha it does exactly what you'd expect, if you specify bias=0.5 you get a (transparent) gray response. This also applies to the case when preserveAlpha=true.
participants (2)
-
Erik Dahlström
-
Jasper van de Gronde