BlurMask
Apply a blur effect to the edges of shapes.| Name | Type | Description |
|---|---|---|
| blur | number | Blur radius |
| style | BlurStyle | Blur style (default: “normal”) |
| respectCTM | boolean | Respect transform (default: true) |
Blur Styles
Mask filters support different blur styles that control how the blur affects the edges:Normal
Blurs inside and outside the shape’s edges.Solid
Draws the shape solid with a blurred outer edge.Outer
Only blurs outside the shape’s edges.Inner
Only blurs inside the shape’s edges.Examples
Glow Effect
Create a glowing effect using outer blur:Soft Edges
Create shapes with soft, feathered edges:Inner Glow
Create an inner glow effect:Neon Effect
Combine multiple blur masks for a neon effect:respectCTM
TherespectCTM property controls whether transformations (scale, rotation) affect the blur radius.
With respectCTM (default)
Blur scales with transformations:Without respectCTM
Blur radius stays constant regardless of transformations:Mask Filters vs Image Filters
Mask Filters:- Only affect the alpha channel (transparency)
- Faster performance
- Best for edge effects and glows
- Applied before color
- Affect the entire rendered output (color and alpha)
- More computationally expensive
- Best for blur, shadows, and color effects
- Applied after rendering
Combining with Other Effects
Mask filters work well with other paint properties:Imperative API
Create mask filters imperatively:Performance Tips
- Mask filters are generally faster than image filters
- Smaller blur radii perform better
- Use
respectCTM={false}for consistent blur at different scales - Consider using mask filters instead of image filters for edge effects
Related
- Image Filters - Blur and other full-content effects
- Color Filters - Color transformations
- Paint Properties - Styling options
- Blend Modes - Compositing operations