Chapter 10. Filters

The preceding chapters have given you a basis for creating graphics that convey information with great precision and detail. If you’re going on a spring picnic, you want a precise map. When you look in the newspaper for the graphics that describe the weather forecast, you want “just the facts.”

If you’re asked later to describe the day of the picnic, nobody wants a crisp recitation of meteorological statistics. Similarly, nobody wants to see a graphic of a spring flower composed of pure vectors; Figure 10-1 fails totally to convey any warmth or charm.

Flower composed of plain vectors
Figure 10-1. Flower composed of plain vectors

Graphics are often designed to evoke feelings or moods as much as they are meant to convey information. Artists who work with bitmap graphics have many tools at their disposal to add such effects; they can produce blurred shadows, selectively thicken or thin lines, add textures to part of the drawing, make an object appear to be embossed or beveled, etc.

How Filters Work

Although SVG is not a bitmap description language, it still lets you use some of these same tools. When an SVG viewer program processes a graphic object, it will render the object to some bitmapped output device; at some point the program will convert the object’s description into the appropriate set of pixels that appear on the output device. Now let’s say that you use the SVG <filter> element to specify ...

Get SVG Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.