XML technologies / SVG / Filters, transformations and gradients / Defining shadows and lighting effects with filters

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

We now reach one of SVG’s most interesting topics, in my opinion. Like good image editors, SVG can define shadows, alpha filters and masks or generate lighting effects. Unlike most graphics programs, it does so without converting vectors into bitmaps. You retain vector graphics’ advantages without sacrificing bitmap features. Filters make this possible. Several examples illustrate it before the next section (see Using and combining filters and lighting effects effectively) explains the individual commands in detail.

What are filters?

You probably know filters from image editing programs: changing colors, converting negatives to positives, or blurring images, for example.

SVG works similarly. Create filters with the <filter> tag in the <defs> section of the SVG file. They contain simple filter elements that can be connected for complex processing. Each filter needs a name assigned with the <id> attribute.

   

   

 

 

 

back to top