ImageGear .NET v25.2 - Updated October 17, 2024
ImageIsGray Method
Example 




ImageGear.Core Assembly > ImageGear.Processing Namespace > ImGearRasterProcessing Class : ImageIsGray Method
Image to test.
Returns true if either the image has GrayScale color space or its palette is gray or inverted gray.
Syntax
'Declaration
 
Public Shared Function ImageIsGray( _
   ByVal page As ImGearRasterPage _
) As Boolean
 
'Usage
 
Dim page As ImGearRasterPage
Dim value As Boolean
 
value = ImGearRasterProcessing.ImageIsGray(page)

Parameters

page
Image to test.

Return Value

Boolean value.
Remarks
This method returns true if either of the two conditions are met:
Example
// Make sure the image is gray.
if (!ImGearRasterProcessing.ImageIsGray(igRasterPage))
    return;
// Create a LUT to convert image from 8bit to 4bit while also inverting.
ImGearMultichannelLUT igMultichannelLUT = new ImGearMultichannelLUT(
    igRasterPage.DIB.ChannelCount, 8, 4);
for (int i = 0; i < 255; ++i )
{
    igMultichannelLUT[0][i] = 15 - (i / 16);
}
// Transform the image with the LUT.
ImGearRasterProcessing.TransformWithLUT(igRasterPage,igMultichannelLUT);
See Also

Reference

ImGearRasterProcessing Class
ImGearRasterProcessing Members
ImGearRasterPage Class

Is this page helpful?
Yes No
Thanks for your feedback.