Chapter 9. Clipping, Masking, Compositing

In earlier chapters, we looked at the use of various types of SVG “paint”—solid colors, gradients, patterns, and so on. In this chapter, we will look at the use of clipping and masking in SVG. If you don't have a background in graphics, you may not be familiar with exactly what clipping and masking are.

Clipping and masking can be viewed as techniques to modify where SVG paint is to be applied and some of the characteristics of SVG paint. An alternative, and less formal, way to view clipping and masking is to view clipping as cutting (clipping) out an arbitrary shape from an image and masking as applying potentially ...

Get SVG Unleashed 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.