The feConvolveMatrix SVG element specifies a matrix convolution filter effect.
A convolution combines pixels in the input image with neighboring pixels to produce a resulting image. A wide variety of imaging operations can be achieved through convolutions, including blurring, edge detection, sharpening, embossing and beveling.
Specifies addition to each component after applying the kernelMatrix to the input image and after applying the divisor.
Value
<number>
Default
0
divisor
Specifies division from the number yielded after applying the kernelMatrix to the input image.
Value
<number>
Default
(sum of all values in kernelMatrix or 1 if sum is 0)
edgeMode
Specifies how to extend the input image as necessary with color values so that the matrix operations can be applied when the kernel is positioned at or near the edge of the input image.
Value
duplicate | wrap | none
Default
duplicate
in
Specifies the input for the filter primitive.
If no value is provided and this is the first filter primitive, then this filter primitive will use SourceGraphic as its input. If no value is provided and this is a subsequent filter primitive, then this filter primitive will use the result from the previous filter primitive as its input.
Specifies the list of numbers that make up the kernel matrix for the convolution.
Values are separated by space characters and/or a comma. The number of entries in the list must equal orderX times orderY.
Value
<list-of-numbers>
Default
(none)
order
Specifies the number of cells in each dimension for kernelMatrix.
The values provided must be integers greater than zero. The first number, orderX, indicates the number of columns in the matrix. The second number, orderY, indicates the number of rows in the matrix. If orderY is not provided, it defaults to orderX.
Value
<number-optional-number>
Default
3
preserveAlpha
Specifies whether the convolution will preserve the alpha channel.
Value
false | true
Default
false
targetX
Specifies the positioning in X of the convolution matrix relative to a given target pixel in the input image.
The leftmost column of the matrix is column number zero. The value must be such that: 0 <= targetX < orderX.
Value
<integer>
Default
floor ( orderX / 2 )
targetY
Specifies the positioning in Y of the convolution matrix relative to a given target pixel in the input image.
The topmost row of the matrix is row number zero. The value must be such that: 0 <= targetY < orderY.