About this endpoint
What it does
Extracts a colour palette from an uploaded image and returns the dominant colour plus the palette colors derived from that image. The number of colours to extract can be controlled with the colors request body field.
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| file | String | No | Image file to analyze. Binary upload (format: binary). |
| colors | Integer | No | Number of colours to extract. Default: 5. Minimum: 1. Maximum: 20. |
Response
Returns a JSON object with palette, dominant, and rgb_palette fields. palette and rgb_palette are arrays, while dominant is a string containing the dominant HEX colour.
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| palette | String Array | No | HEX colours sorted by dominance. |
| dominant | String | No | HEX colour of the most dominant pixel cluster. |
| rgb_palette | Object Array | No | Array of RGB colour objects. Each object contains r, g, and b integer fields. |