Check if specified 8 bpp image is grayscale.

Namespace:  AForge.Imaging
Assembly:  AForge.Imaging (in AForge.Imaging.dll) Version: 2.2.5.0 (2.2.5.0)

Syntax

C#
public static bool IsGrayscale(
	Bitmap image
)

Parameters

image
Type: System.Drawing..::.Bitmap
Image to check.

Return Value

Returns true if the image is grayscale or false otherwise.

Remarks

The methods checks if the image is a grayscale image of 256 gradients. The method first examines if the image's pixel format is Format8bppIndexed and then it examines its palette to check if the image is grayscale or not.

See Also