Matrix3x3 node

This documentation is for version 1.0 of Matrix3x3 (eu.cimg.CImgMatrix3x3).

Description

Compute the convolution of the input image with the specified matrix.

This works by multiplying each surrounding pixel of the input image with the corresponding matrix coefficient (the current pixel is at the center of the matrix), and summing up the results.

For example [-1 -1 -1] [-1 8 -1] [-1 -1 -1] produces an edge detection filter (which is an approximation of the Laplacian filter) by multiplying the center pixel by 8 and the surrounding pixels by -1, and then adding the nine values together to calculate the new value of the center pixel.

Uses the CImg library.

CImg is a free, open-source library distributed under the CeCILL-C (close to the GNU LGPL) or CeCILL (compatible with the GNU GPL) licenses. It can be used in commercial applications (see http://cimg.eu).

Inputs

Input

Description

Optional

Source

No

Mask

Yes

Controls

Parameter / script name

Type

Default

Function

/ matrix31

Double

0

Matrix coefficient.

/ matrix32

Double

0

Matrix coefficient.

/ matrix33

Double

0

Matrix coefficient.

/ matrix21

Double

0

Matrix coefficient.

/ matrix22

Double

0

Matrix coefficient.

/ matrix23

Double

0

Matrix coefficient.

/ matrix11

Double

0

Matrix coefficient.

/ matrix12

Double

0

Matrix coefficient.

/ matrix13

Double

0

Matrix coefficient.

Normalize / normalize

Boolean

Off

Normalize the matrix coefficients so that their sum is 1.

(Un)premult / premult

Boolean

Off

Divide the image by the alpha channel before processing, and re-multiply it afterwards. Use if the input images are premultiplied.

Invert Mask / maskInvert

Boolean

Off

When checked, the effect is fully applied where the mask is 0.

Mix / mix

Double

1

Mix factor between the original and the transformed image.