Skip to main content

Grayscale

Detects and corrects images to be in grayscale.

Parameter table

paramunitrequireddescription
noColorChannelbooleannoIf this parameter is set to true, the rule only accepts grayscale images coded on one channel (and potentially an alpha channel).
If this parameter is set to false, the rule accepts all greyscale images.

Detailed description

The image validation algorithm of this rule checks if the image is in grayscale. By default, it accepts grayscale images with or without an alpha channel, as well as RGB(A) images where the red, green, and blue channels are equal. If the optional parameter 'noColorChannel' is set to true, the rule only accepts images encoded on a single channel (for grayscale) and potentially an alpha channel for transparency.

Correction

The correction process of this rule generates a grayscale image encoded on a single channel to represent the intensity of gray. If the original image had an alpha channel, it is retained in the corrected image to preserve transparency. The format of the corrected image is PNG.

Examples

valuevalidnoColorChanneldescription
HeightmapThe image should be in grayscale.
Heightmap1The image should be in grayscale.
DiamondThe image should be in grayscale.