Grayscale
Detects and corrects images to be in grayscale.
Parameter table
param | unit | required | description |
---|---|---|---|
noColorChannel | boolean | no | If 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
value | valid | noColorChannel | description |
---|---|---|---|
✅ | The image should be in grayscale. | ||
❌ | 1 | The image should be in grayscale. | |
❌ | The image should be in grayscale. |