get_dominant_colors
Extract the dominant colors from an image using K-means clustering. Returns exact hex codes and percentages for each color.
Instructions
Extract the dominant colors from an image.
Uses K-means clustering to find the most prominent colors. Returns exact hex codes and percentages.
Args: image_path: Path to the image num_colors: Number of colors to return (1-5)
Returns: List of hex codes with percentages.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"image_path": "<image_path>"
},
"name": "get_dominant_colors"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| image_path | Yes | ||
| num_colors | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |