Skip to content
Fourohtwo

Takes an image by URL or inline base64 and returns its colour palette

medien.halowerk.com/v1/image-palette

Takes an image by URL or inline base64 and returns its colour palette: up to sixteen colours, each with the share of the visible area it covers, its HEX and sRGB values, its OKLCH coordinates, and the WCAG 2.1 contrast ratio against white, against black and against every other colour in the palette. The grouping runs in OKLab rather than RGB, because distance in RGB does not match what an eye sees

BaseAnswering
POSThttps://medien.halowerk.com/v1/image-palette

Uptime100% of 1 check in 30 days

30 days agoToday

Try it

Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.

The response shows up here.

Call it from an agent

import { createPayer } from "fourohtwo";

// One agent key pays USDC on Base or USDG on Robinhood Chain,
// inside the spending rules you set on Fourohtwo.
const pay = createPayer({ privateKey: process.env.AGENT_KEY });
const res = await pay("https://medien.halowerk.com/v1/image-palette", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"include_contrast":true,"max_colors":4,"min_share_pct":1,"source":{"content_base64":"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAIAAAAC64paAAAAKklEQVR42mO4aGKBB+l1h+NBDKOaRzUT1CzvtwIPenFECw8a1TyqmaBmACXxCf9EgyxCAAAAAElFTkSuQmCC","filename":"beispiel.png"}}),
});
console.log(await res.json());

Example input

{
  "include_contrast": true,
  "max_colors": 4,
  "min_share_pct": 1,
  "source": {
    "content_base64": "iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAIAAAAC64paAAAAKklEQVR42mO4aGKBB+l1h+NBDKOaRzUT1CzvtwIPenFECw8a1TyqmaBmACXxCf9EgyxCAAAAAElFTkSuQmCC",
    "filename": "beispiel.png"
  }
}

More from HALOWERK Medien