Extract Dominant Palette Colours
palette_extractExtract dominant colours from an image using k-means++ clustering. Accepts a public image URL or base64-encoded image. Returns hex values with proportional weights sorted by luminance. Optionally runs palette_analyse on the results. Returns hex values with proportions, the input palette_analyse and palette_swatch take. The result already carries the rendered palette and its PNG, PDF, ASE, JSON and CSS downloads, ready to show the customer. The archive anchors a colour was derived from are evidence, not the recommended colours. A final palette chosen from this evidence is registered with palette_finalize, called once with those exact colours, so the customer can see and download what was actually recommended.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "palette_extract"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| k | No | Number of colours to extract (3-12, default 6) | |
| analyse | No | If true, also run palette_analyse on the extracted colours and return archive names | |
| archive | No | Explicit single archive name to restrict matching to e.g. 'MarsColour', 'Japan', 'Victorian'. | |
| image_id | No | Ephemeral image_id from ingest_image (preferred for images over 50 KB) | |
| image_url | No | Public URL of the image to extract colours from | |
| image_base64 | No | Base64-encoded image data (small images only, under 50 KB) | |
| grey_card_hex | No | Hex value sampled from a grey or white card in the image for white balance correction e.g. #C8C8C8 | |
| style_context | No | Plain English style description that restricts archive matching to a coherent set e.g. 'English cottage garden', 'Victorian', 'Japanese', 'MarsColour', 'Arts and Crafts'. Prevents palette colours from being named across unrelated archives. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||