Max Color Count
This rule checks that the image does not exceed the specified maximum number of colors.
Parameter table
param | unit | required | description |
---|---|---|---|
maxColorCount | Count | no | Maximum number of colors allowed in the image (maxColorCount ). |
mask | no | Binary image to define regions of interest |
Detailed description
This rule checks that the image does not exceed a specified maximum number of colors.The checking process involves iterating through the pixels of the image to count unique colors.The validation ensures that the count does not exceed the specified maximum color count.
If a mask is provided, only the portion of the image corresponding to the white areas of the mask is considered.
Correction
The correction process involves color quantization using the K-means algorithm with K equal to the specified maximum color count. The image is transformed by reducing the number of distinct colors while preserving visual quality.
If a mask is provided, only the portion of the image corresponding to the white areas of the mask is corrected.
How to setup
This rule evaluates whether an image's color count conforms to the specified maximum limit. The only parameter is:
maxColorCount
: Maximum number of colors allowed in the image.mask
: Binary image to define regions of interest.
Creator tips
To reduce the number of colors with greater flexibility, consider the following resources:
- Explore tutorials on color reduction in Photoshop: YouTube Tutorial
- Refer to the GIMP documentation on converting images to indexed mode: GIMP Indexed Mode
Examples
value | valid | maxColorCount | description |
---|---|---|---|
✅ | 16 | The image should have a maximum of 16 colors. | |
❌ | 16 | The image should have a maximum of 16 colors. |