XML technologies / SVG / Filters, transformations and gradients / Using and combining filters and lighting effectively / Universal attributes for filter elements

(Excerpt from “Das Einsteigerseminar SVG — Webgrafiken mit XML” by Helma Spona)

As with many SVG elements, elements within a <filter> tag have attributes available generally or almost throughout. These are called universal attributes and apply to almost all <fe...> tags.

Note:
Any exceptions to the following explanations are discussed for the respective filter element below.

The universal attributes for filter elements are:

The following example illustrates this. First apply the shadow from the previous example to the alpha channel of the button and text, using this code:

<filter id="AlphaSchatten" >
  <feGaussianBlur in="SourceAlpha" stdDeviation="3"/>
</filter>

Result of the SourceAlpha value for the in parameter

Figure: Result of the SourceAlpha value for the in parameter.

If instead the filter assigned to the text uses the value fillPaint for the attribute in, the following listing produces this result:

<filter id="StrokeSchatten">
  <feGaussianBlur in="FillPaint" stdDeviation="3"/>
</filter>

SourceAlpha is used as input on the left, FillPaint on the right

Figure: SourceAlpha is used as input on the left, FillPaint on the right.

   

 

 

 

back to top