|
|
Donner 0.5.1
Embeddable browser-grade SVG2 engine
|
<feBlend> combines two inputs using a blend mode, similar to the layer blend modes in Photoshop, GIMP, or Figma.
The result takes the colors of in (the "top" layer) and in2 (the "bottom" layer) and merges them pixel-by-pixel according to the formula for the chosen mode.
If you have ever stacked two layers in an image editor and changed the top layer's blend mode from "Normal" to "Multiply" or "Screen", <feBlend> does the same thing inside an SVG filter graph. It does not decide which pixels are kept (that is what "<feComposite>" does); it only decides how the colors of two already-overlapping layers are mixed.
The grid below shows every blend mode SVG supports. Each cell overlaps a red circle on top of a blue circle using the named mode.
The 16 modes are grouped into five families by what they do to the underlying pixels:
A minimal filter that multiplies the source graphic by a solid red background:
| Attribute | Default | Description |
|---|---|---|
| in | previous | First (top) input, named filter result or one of SourceGraphic, SourceAlpha, FillPaint, StrokePaint. |
| in2 | (none) | Second (bottom) input. Required. |
| mode | normal | One of normal, multiply, screen, overlay, darken, lighten, color-dodge, color-burn, hard-light, soft-light, difference, exclusion, hue, saturation, color, luminosity. |
Inherits standard filter primitive attributes from SVGFilterPrimitiveStandardAttributes (x, y, width, height, result).