GET /v1/dominant-colorExtract dominant colors
Image Utils lf-image-utils
Finds the strongest colors in an image. Extracts dominant colors from base64 image data or image URL using k-means clustering. Returns colors as RGB values and hex codes.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
data | string | Yes | Base64 image data or URL |
count | integer | No | Number of colors to extract |
Response Schema
success (boolean): Operation success
source (string): Source type
dominant_colors (array): Color objects with hex and weight
image_size (integer): Size in bytes
cURL Example
curl 'https://lf-image-utils.laminarforge.dev/v1/dominant-color?data=<base64_data>' -H 'Authorization: Bearer lf_YourApiKey'
Python Example
import requests
url = 'https://lf-image-utils.laminarforge.dev/v1/dominant-color'
headers = {'Authorization': 'Bearer lf_YourApiKey'}
params = {'data': '<base64_data>'}
response = requests.get(url, headers=headers, params=params)
print(response.json())