Table of Contents

Class KnownFilterMatrices

Namespace
SixLabors.ImageSharp.Processing
Assembly
SixLabors.ImageSharp.dll

A collection of known ColorMatrix values for composing filters

public static class KnownFilterMatrices
Inheritance
KnownFilterMatrices
Inherited Members

Properties

AchromatomalyFilter

Gets a filter recreating Achromatomaly (Color desensitivity) color blindness

public static ColorMatrix AchromatomalyFilter { get; }

Property Value

ColorMatrix

AchromatopsiaFilter

Gets a filter recreating Achromatopsia (Monochrome) color blindness.

public static ColorMatrix AchromatopsiaFilter { get; }

Property Value

ColorMatrix

BlackWhiteFilter

Gets an approximated black and white filter

public static ColorMatrix BlackWhiteFilter { get; }

Property Value

ColorMatrix

DeuteranomalyFilter

Gets a filter recreating Deuteranomaly (Green-Weak) color blindness.

public static ColorMatrix DeuteranomalyFilter { get; }

Property Value

ColorMatrix

DeuteranopiaFilter

Gets a filter recreating Deuteranopia (Green-Blind) color blindness.

public static ColorMatrix DeuteranopiaFilter { get; }

Property Value

ColorMatrix

KodachromeFilter

Gets a filter recreating an old Kodachrome camera effect.

public static ColorMatrix KodachromeFilter { get; }

Property Value

ColorMatrix

LomographFilter

Gets a filter recreating an old Lomograph camera effect.

public static ColorMatrix LomographFilter { get; }

Property Value

ColorMatrix

PolaroidFilter

Gets a filter recreating an old Polaroid camera effect.

public static ColorMatrix PolaroidFilter { get; }

Property Value

ColorMatrix

ProtanomalyFilter

Gets a filter recreating Protanomaly (Red-Weak) color blindness.

public static ColorMatrix ProtanomalyFilter { get; }

Property Value

ColorMatrix

ProtanopiaFilter

Gets a filter recreating Protanopia (Red-Blind) color blindness.

public static ColorMatrix ProtanopiaFilter { get; }

Property Value

ColorMatrix

TritanomalyFilter

Gets a filter recreating Tritanomaly (Blue-Weak) color blindness.

public static ColorMatrix TritanomalyFilter { get; }

Property Value

ColorMatrix

TritanopiaFilter

Gets a filter recreating Tritanopia (Blue-Blind) color blindness.

public static ColorMatrix TritanopiaFilter { get; }

Property Value

ColorMatrix

Methods

CreateBrightnessFilter(float)

Create a brightness filter matrix using the given amount.

public static ColorMatrix CreateBrightnessFilter(float amount)

Parameters

amount float

The proportion of the conversion. Must be greater than or equal to 0.

Returns

ColorMatrix

The ColorMatrix

Remarks

A value of 0 will create an image that is completely black. A value of 1 leaves the input unchanged. Other values are linear multipliers on the effect. Values of an amount over 1 are allowed, providing brighter results.

CreateContrastFilter(float)

Create a contrast filter matrix using the given amount.

public static ColorMatrix CreateContrastFilter(float amount)

Parameters

amount float

The proportion of the conversion. Must be greater than or equal to 0.

Returns

ColorMatrix

The ColorMatrix

Remarks

A value of 0 will create an image that is completely gray. A value of 1 leaves the input unchanged. Other values are linear multipliers on the effect. Values of an amount over 1 are allowed, providing results with more contrast.

CreateGrayscaleBt601Filter(float)

Create a grayscale filter matrix using the given amount using the formula as specified by ITU-R Recommendation BT.601. https://en.wikipedia.org/wiki/Luma_%28video%29#Rec._601_luma_versus_Rec._709_luma_coefficients

public static ColorMatrix CreateGrayscaleBt601Filter(float amount)

Parameters

amount float

The proportion of the conversion. Must be between 0 and 1.

Returns

ColorMatrix

The ColorMatrix

CreateGrayscaleBt709Filter(float)

Create a grayscale filter matrix using the given amount using the formula as specified by ITU-R Recommendation BT.709. https://en.wikipedia.org/wiki/Rec._709#Luma_coefficients

public static ColorMatrix CreateGrayscaleBt709Filter(float amount)

Parameters

amount float

The proportion of the conversion. Must be between 0 and 1.

Returns

ColorMatrix

The ColorMatrix

CreateHueFilter(float)

Create a hue filter matrix using the given angle in degrees.

public static ColorMatrix CreateHueFilter(float degrees)

Parameters

degrees float

The angle of rotation in degrees.

Returns

ColorMatrix

The ColorMatrix

CreateInvertFilter(float)

Create an invert filter matrix using the given amount.

public static ColorMatrix CreateInvertFilter(float amount)

Parameters

amount float

The proportion of the conversion. Must be between 0 and 1.

Returns

ColorMatrix

The ColorMatrix

CreateLightnessFilter(float)

Create a lightness filter matrix using the given amount.

public static ColorMatrix CreateLightnessFilter(float amount)

Parameters

amount float

The proportion of the conversion. Must be greater than or equal to 0.

Returns

ColorMatrix

The ColorMatrix

Remarks

A value of 0 will create an image that is completely black. A value of 1 leaves the input unchanged. Other values are linear multipliers on the effect. Values of an amount over 1 are allowed, providing lighter results.

CreateOpacityFilter(float)

Create an opacity filter matrix using the given amount.

public static ColorMatrix CreateOpacityFilter(float amount)

Parameters

amount float

The proportion of the conversion. Must be between 0 and 1.

Returns

ColorMatrix

The ColorMatrix

CreateSaturateFilter(float)

Create a saturation filter matrix using the given amount.

public static ColorMatrix CreateSaturateFilter(float amount)

Parameters

amount float

The proportion of the conversion. Must be greater than or equal to 0.

Returns

ColorMatrix

The ColorMatrix

Remarks

A value of 0 is completely un-saturated. A value of 1 leaves the input unchanged. Other values are linear multipliers on the effect. Values of amount over 1 are allowed, providing super-saturated results

CreateSepiaFilter(float)

Create a sepia filter matrix using the given amount. The formula used matches the svg specification. http://www.w3.org/TR/filter-effects/#sepiaEquivalent

public static ColorMatrix CreateSepiaFilter(float amount)

Parameters

amount float

The proportion of the conversion. Must be between 0 and 1.

Returns

ColorMatrix

The ColorMatrix