Class: ConvolutionFilter

ConvolutionFilter

The ConvolutionFilter class applies a matrix convolution filter effect. A convolution combines pixels in the input image with neighboring pixels to produce a new image. A wide variety of image effects can be achieved through convolutions, including blurring, edge detection, sharpening, embossing, and beveling. The matrix should be specified as a 9 point Array. See https://docs.gimp.org/2.10/en/gimp-filter-convolution-matrix.html for more info.
originalfilter

new ConvolutionFilter (options)

Name Type Attributes Description
options ConvolutionFilterOptions <optional>

Options for the ConvolutionFilter constructor.

Extends

  • Filter

Members

DEFAULT_OPTIONS ConvolutionFilterOptions staticreadonly

Default values for options.

height number

Height of the object you are transforming

Default Value:
  • 200

matrix ConvolutionMatrix

An array of values used for matrix transformation, specified as a 9 point Array

Default Value:
  • [0,0,0,0,0,0,0,0,0]
Example
const matrix = new Float32Array(9); // 9 elements of value 0
const matrix = [0,0.5,0,0.5,1,0.5,0,0.5,0];

width number

Width of the object you are transforming

Default Value:
  • 200