Vachmi

The <feColorMatrix> SVG filter element changes colors based on a transformation matrix.

Attributes

Attribute
Description
in
Identifies the input for the given filter primitive
type
Specifies the type of matrix operation.
Possible values are
• matrix
• saturate
• hueRotate
• luminanceToAlpha
values
The values attribute is a semicolon-separated list of one or more values. The values attribute in feColorMatrix depends upon the 'type' attribute used.
Possible values are
• For type='matrix', values is a list of 20 matrix values (a00 a01 a02 a03 a04 a10 a11 ... a34), separated by whitespace and/or a comma.
• For type="saturate", values is a single real number value (0 to 1).
• For type="hueRotate", values is a single one real number value (degrees).
• For type="luminanceToAlpha", values is not applicable.

Here is the SVG code to draw this filter with type="matrix".

<filter id="filter1">
 <feColorMatrix in="SourceGraphic" type="matrix"
  values="1 0 0 0 0
        1 1 1 1 0
        0 0 1 0 0
        0 0 0 1 0" />
</filter>


Original Image with no filter
Image with type='matrix'
Image with type='saturate'
Image with type='hueRotate'
Image with type='luminanceToAlpha'