GET /v1/color-paletteExtract color palette
Image Utils lf-image-utils
Picks out the main colors in a picture so you can reuse them. Extracts a color palette from base64 image data or URL using k-means clustering. Configurable color count (2-32).
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
data | string | Yes | Base64 image data or URL |
count | integer | No | Number of palette colors |
Response Schema
success (boolean): Operation success
source (string): Source type
palette (array): Array of color objects
image_size (integer): Image size in bytes
cURL Example
curl 'https://lf-image-utils.laminarforge.dev/v1/color-palette?data=<base64_data>' -H 'Authorization: Bearer lf_YourApiKey'
Python Example
import requests
url = 'https://lf-image-utils.laminarforge.dev/v1/color-palette'
headers = {'Authorization': 'Bearer lf_YourApiKey'}
params = {'data': '<base64_data>'}
response = requests.get(url, headers=headers, params=params)
print(response.json())