Table of Contents

Class GrayscaleExtensions

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

Defines extensions that allow the application of grayscale toning to an Image using Mutate/Clone.

public static class GrayscaleExtensions
Inheritance
GrayscaleExtensions
Inherited Members

Methods

Grayscale(IImageProcessingContext)

Applies Bt709 grayscale toning to the image.

public static IImageProcessingContext Grayscale(this IImageProcessingContext source)

Parameters

source IImageProcessingContext

The current image processing context.

Returns

IImageProcessingContext

The IImageProcessingContext.

Grayscale(IImageProcessingContext, GrayscaleMode)

Applies grayscale toning to the image with the given GrayscaleMode.

public static IImageProcessingContext Grayscale(this IImageProcessingContext source, GrayscaleMode mode)

Parameters

source IImageProcessingContext

The current image processing context.

mode GrayscaleMode

The formula to apply to perform the operation.

Returns

IImageProcessingContext

The IImageProcessingContext.

Grayscale(IImageProcessingContext, GrayscaleMode, Rectangle)

Applies grayscale toning to the image.

public static IImageProcessingContext Grayscale(this IImageProcessingContext source, GrayscaleMode mode, Rectangle rectangle)

Parameters

source IImageProcessingContext

The current image processing context.

mode GrayscaleMode

The formula to apply to perform the operation.

rectangle Rectangle

The Rectangle structure that specifies the portion of the image object to alter.

Returns

IImageProcessingContext

The IImageProcessingContext.

Grayscale(IImageProcessingContext, GrayscaleMode, float)

Applies grayscale toning to the image with the given GrayscaleMode using the given amount.

public static IImageProcessingContext Grayscale(this IImageProcessingContext source, GrayscaleMode mode, float amount)

Parameters

source IImageProcessingContext

The current image processing context.

mode GrayscaleMode

The formula to apply to perform the operation.

amount float

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

Returns

IImageProcessingContext

The IImageProcessingContext.

Grayscale(IImageProcessingContext, GrayscaleMode, float, Rectangle)

Applies grayscale toning to the image using the given amount.

public static IImageProcessingContext Grayscale(this IImageProcessingContext source, GrayscaleMode mode, float amount, Rectangle rectangle)

Parameters

source IImageProcessingContext

The current image processing context.

mode GrayscaleMode

The formula to apply to perform the operation.

amount float

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

rectangle Rectangle

The Rectangle structure that specifies the portion of the image object to alter.

Returns

IImageProcessingContext

The IImageProcessingContext.

Grayscale(IImageProcessingContext, Rectangle)

Applies Bt709 grayscale toning to the image.

public static IImageProcessingContext Grayscale(this IImageProcessingContext source, Rectangle rectangle)

Parameters

source IImageProcessingContext

The current image processing context.

rectangle Rectangle

The Rectangle structure that specifies the portion of the image object to alter.

Returns

IImageProcessingContext

The IImageProcessingContext.

Grayscale(IImageProcessingContext, float)

Applies Bt709 grayscale toning to the image using the given amount.

public static IImageProcessingContext Grayscale(this IImageProcessingContext source, float amount)

Parameters

source IImageProcessingContext

The current image processing context.

amount float

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

Returns

IImageProcessingContext

The IImageProcessingContext.

Grayscale(IImageProcessingContext, float, Rectangle)

Applies Bt709 grayscale toning to the image using the given amount.

public static IImageProcessingContext Grayscale(this IImageProcessingContext source, float amount, Rectangle rectangle)

Parameters

source IImageProcessingContext

The current image processing context.

amount float

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

rectangle Rectangle

The Rectangle structure that specifies the portion of the image object to alter.

Returns

IImageProcessingContext

The IImageProcessingContext.