Dominant Color¶
Class: DominantColorBlockV1
Source: inference.core.workflows.core_steps.classical_cv.dominant_color.v1.DominantColorBlockV1
Extract the dominant color from an input image using K-means clustering.
This block identifies the most prevalent color in an image. Processing time is dependant on color complexity and image size. Most images should complete in under half a second.
The output is a list of RGB values representing the dominant color, making it easy to use in further processing or visualization tasks.
Note: The block operates on the assumption that the input image is in RGB format.
Type identifier¶
Use the following identifier in step "type"
field: roboflow_core/dominant_color@v1
to add the block as
as step in your workflow.
Properties¶
Name | Type | Description | Refs |
---|---|---|---|
name |
str |
Enter a unique identifier for this step.. | ❌ |
color_clusters |
int |
Number of dominant colors to identify. Higher values increase precision but may slow processing.. | ✅ |
max_iterations |
int |
Max number of iterations to perform. Higher values increase precision but may slow processing.. | ✅ |
target_size |
int |
Sets target for the smallest dimension of the downsampled image in pixels. Lower values increase speed but may reduce precision.. | ✅ |
The Refs column marks possibility to parametrise the property with dynamic values available
in workflow
runtime. See Bindings for more info.
Available Connections¶
Compatible Blocks
Check what blocks you can connect to Dominant Color
in version v1
.
- inputs:
Relative Static Crop
,Crop Visualization
,Grid Visualization
,Stability AI Inpainting
,SIFT Comparison
,Reference Path Visualization
,Distance Measurement
,Line Counter
,Image Blur
,Keypoint Visualization
,SIFT
,Blur Visualization
,Image Threshold
,Image Slicer
,SIFT Comparison
,Image Preprocessing
,Stability AI Image Generation
,Trace Visualization
,Classification Label Visualization
,Mask Visualization
,Image Convert Grayscale
,Line Counter
,Pixel Color Count
,Stability AI Outpainting
,Perspective Correction
,Polygon Zone Visualization
,Template Matching
,Camera Calibration
,Line Counter Visualization
,Icon Visualization
,Dot Visualization
,Model Comparison Visualization
,Pixelate Visualization
,Dynamic Crop
,QR Code Generator
,Image Slicer
,Bounding Box Visualization
,Halo Visualization
,Absolute Static Crop
,Depth Estimation
,Image Contours
,Background Color Visualization
,Ellipse Visualization
,Circle Visualization
,Camera Focus
,Corner Visualization
,Triangle Visualization
,Color Visualization
,Stitch Images
,Label Visualization
,Polygon Visualization
- outputs:
Dynamic Crop
,Pixel Color Count
Input and Output Bindings¶
The available connections depend on its binding kinds. Check what binding kinds
Dominant Color
in version v1
has.
Bindings
-
input
image
(image
): The input image for this step..color_clusters
(integer
): Number of dominant colors to identify. Higher values increase precision but may slow processing..max_iterations
(integer
): Max number of iterations to perform. Higher values increase precision but may slow processing..target_size
(integer
): Sets target for the smallest dimension of the downsampled image in pixels. Lower values increase speed but may reduce precision..
-
output
rgb_color
(rgb_color
): RGB color.
Example JSON definition of step Dominant Color
in version v1
{
"name": "<your_step_name_here>",
"type": "roboflow_core/dominant_color@v1",
"image": "$inputs.image",
"color_clusters": 4,
"max_iterations": 100,
"target_size": 100
}