API & MCP
Everything a person can do on Image Palette Extractor (k-means, median cut), a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://luminapaletteextractor.usefulweb.app/api/v1/calculate– run Image Palette Extractor (k-means, median cut)GET https://luminapaletteextractor.usefulweb.app/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
Image Palette Extractor (k-means, median cut)
Upload a PNG, JPEG, WebP or GIF image and get its main colors with the share of the image each one covers, plus how well the palette represents the image. Download the palette as HEX, GIMP GPL, JASC-PAL, JSON, CSS variables or Adobe Swatch Exchange (ASE).
| Field | Type | Default | Description |
|---|---|---|---|
image (required) | file | — | Image (PNG, JPEG, WebP or GIF; up to 25 MB) |
method | select (kmeans, median-cut, histogram) | "kmeans" | Method |
count | integer | 6 | Number of colors |
name | text | "Image palette" | Palette name |
Example request
Four color fields (generated sample)
curl -X POST https://luminapaletteextractor.usefulweb.app/api/v1/calculate -H 'content-type: application/json' -d '{"image":{"filename":"four-fields.png","contentType":"image/png","contentBase64":"iVBORw0KGgoAAAANSUhEUgAAAGAAAABACAYAAADlNHIOAAADHklEQVR42u3RWTabYQCA4W8PkuwINd5WixYtWorEPO/AGBFibOlNzVoUNfR0MoskMidEDDF02MHX86/A1Rvnz8nFs4H3FbrMF5JU+X4UdfcviLr92ooS8QGxPmB8BHX7N4C62WxFCV1mgSQZxkdQ/IAWlNBlFEgSPeDmjx91vdmC4geMDaPwARstKNUPuP7tQ0U2WlD4AP3YMAofsN6MErqMfEnSvxtGRe58qKv1ZlQUBgyhIndeVHzAfQNuvairtWaU0KXnSxI94OrWg7pca0IJbXq+JFW8HUTFBzzwgMsbD+riSxNKaNPzJIkf4Eapf8DoAOri2o06X21ExcAAF4ofkJYnSeWjA6jziAsVXm1E8QNGBlDnEScqvNKIEtq055JUPmJBha+cqLOVBlR8QKwPKBu2oMKXx6iz5QZUFAb0o86USKDQcgNK/QMuHKjQcj1KaFOfSVLZUD8qpEQCnX6uR0VhQB8qdGFHqX7Am6E+1Om5HXWyVI+KD4j5AYNm1EnYhgou1aHiA+4bsFiHEtrUXEkqHTSjTs6OUPyAlFxJKh0wo4JKJFBgsQ4VhQG9qGDIigos1KJUPyCgRAL5F2pR/ABLLypwakVFYUCOJJVYTCj/6SHK96kWJTQpOZKk/gE1KH5AvwnlOzlAeT/WoITmUY4klfT3oOIDHniAN3jA4gdkS9Lrvh6UN7iP8sxXo9Q/ILCPioEBRpQnsIdyz1ej+AFmI8rj30O556pRQpOcLUmvzEaU27+Lcs1VoaIwoBvl9u2iXLNVKKFJfipJ9ACXEgnknK1C8QN6u1Eu3w4qBgZ0oZzeHdZMJQofUNzbhXJ6t1HHM5UofoCpC+X0bKP4AUlPJKnY1Ik69myhHNOVKPUPcG+hVD+gqKcT5VAigezTBpT6B7h+oexTBlQUBnSg7EokkG3KgBKapCxJKjJ2oOzOnyjbpAGl+gE2JRLoaFKPEprELEkqNLajbMc/UOof0N2OOlIikSb0KJGQmCVJah9gndCjRELiY0kq7G5DHTm+o6wTFSjVD7AqkUCHHypQ+ICXXW0oq/0bih7wHxkxj/COypjgAAAAAElFTkSuQmCC"},"method":"kmeans","count":4,"name":"Four fields"}'
Every result contains
inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.
MCP (Model Context Protocol)
- Streamable HTTP endpoint:
https://luminapaletteextractor.usefulweb.app/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
lumina_palette_extractor - Local stdio connector:
node src/mcp-stdio.ts --tool=lumina-palette-extractor
{
"mcpServers": {
"lumina-palette-extractor": { "type": "http", "url": "https://luminapaletteextractor.usefulweb.app/mcp" }
}
}