Grooper Help - Version 25.0
25.0.0017 2,127
  • Overview
  • Help Status

Color Detection

IP Command Grooper.IP

Analyzes an image to determine whether it contains color.

Remarks

The Color Detection command determines if a document image should be classified as color or grayscale, which is essential for workflows that require color-based processing, storage optimization, or quality control.

How Color Detection Works

Color detection is performed in two main steps:

  1. Ambient Color Analysis:
    The average "color level" of all pixels in the image is calculated. If this average meets or exceeds the 'Ambient Color Threshold', the image is immediately classified as color. If the average is zero, the image is classified as non-color. This step quickly handles images with strong color backgrounds or those that are purely grayscale.

  2. Color Clustering Analysis:
    If the ambient color level is low but nonzero, the command analyzes whether the small amount of color is distributed as background noise or forms meaningful color objects (such as text, lines, highlights, or logos). Pixels are considered "color" if their color level exceeds the 'Clustering Threshold'. Connected color pixels are grouped into clusters, and if any cluster meets or exceeds the 'Minimum Cluster Weight', the image is classified as color.

What is "Color Level"?

The "color level" of a pixel is defined as its Euclidean distance from the grayscale line in RGB color space. In RGB, a pixel is perfectly gray if its red, green, and blue components are equal (e.g., (128,128,128)). In practice, scanners introduce small variations, so even black-and-white images may have pixels like (128,127,129). The color level quantifies how far a pixel deviates from gray, providing a robust measure of colorfulness that accounts for real-world noise and scanner artifacts.

Supported Pixel Formats

  • The command supports all color pixel formats: Pixel24bppBgr, Pixel32bppArgb, etc.
  • Images are automatically converted to a supported color format as needed for processing.

Diagnostics

When run in diagnostic mode, Color Detection generates several outputs to assist with configuration and troubleshooting:

  • Color Level: A grayscale image visualizing the color level of each pixel (darker = more color).
  • Color Clusters: A binary mask showing detected color clusters based on the clustering threshold.
  • Color Objects: An overlay highlighting color objects that triggered a positive result.
  • Log Messages: Reports of ambient color level, total color area, number of color clusters, and final classification.

Use these diagnostics to fine-tune detection parameters and ensure that color and grayscale images are correctly identified.

Tuning and Practical Guidance

  • Ambient Color Threshold:
    Increase to require more overall color for a positive result (useful for ignoring faint backgrounds). Decrease to detect subtle color usage.

  • Clustering Threshold:
    Lower to detect faint or pastel colors; raise to require bold, saturated colors.

  • Minimum Cluster Weight:
    Increase to ignore small color marks or noise; decrease to detect small color features (e.g., logos).

  • Processing Resolution:
    Lower resolutions increase speed but may miss small color details; use higher resolutions for accuracy.

  • Always review diagnostic images and logs to verify that only intended color features trigger a positive result.

  • Adjust parameters iteratively for your specific document set and quality requirements.

Properties

NameTypeDescription
General
Command Info

Used By

Notification