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. Use this instead of image_palette when you need hex values with proportions for palette_analyse or palette_swatch. The result already carries the rendered palette and its PNG, PDF, ASE, JSON and CSS downloads -- show them to the customer. Never present the archive anchors a colour was derived from as the colours you are recommending. If you go on to choose a final palette OF YOUR OWN from this evidence, call palette_finalize once with those exact colours so the customer can see and download what you actually recommended.
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 | |||