htmlsvgfilterglow

Are there other Slope types for creating glow effects in SVG?


Are there other Slope types for creating glow effects in SVG?

I have tried to check the docs, but I've come up with a blank.

The part of the code in question is -

<feFuncA  id="SVG_slope-value" type="linear" slope="3"/>

Here's a Codepen to illustrate what I am talking about.

[CodePen ] http://codepen.io/gingerman/pen/WQypBB

There's also a note on there about another issue that I solved for myself.

Thanks

Steve


Solution

  • Documentation for the component transfer filter is at http://www.w3.org/TR/SVG/filters.html#feComponentTransferElement

    The type attribute can have the following values...

    type = identity | table | discrete | linear | gamma
    

    When type = linear, you can also have slope and intercept attributes. If c is the initial component then the formula for the remapped component c' is...

    c' = slope * c + intercept
    

    In the example you linked to, a Gaussian blur filter is used to create some fuzziness around the object and then a component transfer filter is used to increase the alpha component of the fuzzy area. The end result is a glowing effect. Changing the slope will change the brightness of the glow effect (larger slope results in brighter glow).