Serverless AI Image Color Extraction
Advanced image color analysis service that extracts dominant colors from images with detailed color information including names, hex codes, and dominance scores. Perfect for color palette generation, design analysis, and visual content understanding.
Endpoint
Extract dominant colors from images with detailed color information
POSThttps://api.xtartapp.com/image/color
*Authentication
You must use a Bearer token provided by the dashboard to use for authentication. Add the token to the Authorization header.
Request body
Name | Type | Required | Max | Description |
---|---|---|---|---|
image | string | Yes | - | Filename of the optimized .ximage file previously uploaded to the platform. |
limit | number | No | - | Maximum number of dominant colors to extract (1-5). Defaults to 5 if not specified. |
Response
Name | Type | Description |
---|---|---|
data | array | Array of dominant colors extracted from the image |
data[].name | string | The descriptive name of the color |
data[].hex | string | The hex code of the color in standard 6-digit format |
data[].score | number | The dominance score of the color (sum of all scores equals 1) |
metadata | object | Metadata about the color extraction process |
metadata.cost | number | The cost of the color extraction request |
Errors
{
"error": "string",
"code": "string"
}
HTTP Status | Error Code | Message |
---|---|---|
400 | INVALID_PAYLOAD | Occurs when the payload is invalid or required parameters are missing. |
400 | INVALID_REQUEST | The request is invalid. |
400 | INVALID_IMAGE | The image was not found or is invalid. |
400 | HARM_CONTENT | The content is harmful and cannot be processed. |
400 | INSUFFICIENT_BALANCE | The user has insufficient balance. |
401 | UNAUTHORIZED | The token is invalid. |
429 | TOO_MANY_REQUESTS | The request limit has been reached. |