# feConvolveMatrix element | SVGFEConvolveMatrixElement object

`feConvolveMatrix`

applies a matrix convolution filter effect.

## Syntax

<feConvolveMatrix in='image1' order="3 3" targetX="0" targetY="0" edgeMode="duplicate" kernelMatrix="1 2 3 2 3 4 3 4 5" preserveAlpha='false'/>

## DOM Information

### Inheritance Hierarchy

**Node**

**Element**

**SVGElement**

## Members

The **SVGFEConvolveMatrixElement** object has these types of members:

### Properties

The **SVGFEConvolveMatrixElement** object has these properties.

Property | Description |
---|---|

Shifts the range of the filter. This allows representation of values that would otherwise be clamped to 0 or 1. | |

Affects the final destination color value of the filter. | |

Determines 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. | |

Gets or sets the height of an element. | |

Identifies input for the given filter primitive. | |

The list of numbers that make up the kernel matrix for the convolution. | |

| |

| |

Indicates the number of cells in each dimension for | |

Indicates the number of cells in each dimension for | |

Indicates that the convolution will apply to all channels or just the color channels. | |

Provides a reference for the output result of a filter. | |

Determines the positioning in X of the convolution matrix relative to a given target pixel in the input image. | |

Determines the positioning in Y of the convolution matrix relative to a given target pixel in the input image. | |

Defines the width of an element. | |

Gets or sets the x-coordinate value. | |

Gets or sets the y-coordinate value. |

## Standards information

- Scalable Vector Graphics: Filter Effects, Section 15.25.12

## Remarks

`feConvolveMatrix`

applies 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.

A matrix convolution is based on an *n*-by-*m* matrix (the convolution kernel) which describes how a given pixel value in the input image is combined with its neighboring pixel values to produce a resulting pixel value. Each result pixel is determined by applying the kernel matrix to the corresponding source pixel and its neighboring pixels.

Because they operate on pixels, matrix convolutions are inherently resolution-dependent. To make `feConvolveMatrix`

produce resolution-independent results, an explicit value should be provided for either the **filterRes** attribute on the **filter** element and/or attribute **kernelUnitLength**.

**kernelUnitLength**, in combination with the other attributes, defines an implicit pixel grid in the filter effects coordinate system (that is, the coordinate system established by the **primitiveUnits** attribute). If the pixel grid established by **kernelUnitLength** is not scaled to match the pixel grid established by attribute **filterRes** (implicitly or explicitly), then the input image will be temporarily rescaled to match its pixels with **kernelUnitLength**. The convolution happens on the resampled image. After applying the convolution, the image is resampled back to the original resolution.