|
ImageIsGrayscale Method
|
Check if specified 8 bpp image is grayscale.
Namespace:
Accord.Imaging
Assembly:
Accord.Imaging (in Accord.Imaging.dll) Version: 3.8.0
Syntax public static bool IsGrayscale(
this Bitmap image
)
<ExtensionAttribute>
Public Shared Function IsGrayscale (
image As Bitmap
) As Boolean
Request Example
View SourceParameters
- image
- Type: System.DrawingBitmap
Image to check.
Return Value
Type:
BooleanReturns
true if the image is grayscale or
false otherwise.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
Bitmap. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
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