Hi,
I am trying to apply a SVG filter on a sketch by accessing the context of the canvas (ctx = canvas.getContext("2d")
) and pasting the following in the index.html
file:
<div id="stats"></div>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<defs>
<filter id="goo">
<fegaussianBlur in="SourceGraphic" stddeviation="10" result="blur" />
<fecolormatrix in="blur" mode="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 18 -7"/>
</filter>
</defs>
</svg>
While this seems to work I notice that:
- the position of the canvas has changed (lower than usually)
- calling
background()
breaks the effect
Would someone be kind enough to explain why these changes occur and how to prevent / overcome them ? (changing the background color / setting the canvas correctly)