imagepeek: extract an image's dominant colours
image_colorsRead-onlyIdempotent
imagepeek: Extract the dominant colours of an image. Returns an image's palette of k colours (hex, rgb, share), the dominant one and the average colour with its luminance, from a 200 px sample (median cut refined by k-means; transparent pixels ignored). Input: url or image_base64, optional k and auto_orient. Reads PNG, JPEG, WebP, GIF, TIFF, BMP, ICO and AVIF; other formats and images over 40 megapixels are refused (not charged). Images are never logged or stored. Typically 0.5-2 s. Price: USD 0.002. Free: 3 imagepeek calls per IP per UTC day.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| k | No | Palette size (1-10, default 5). | |
| url | No | Public http(s) URL of the image (at most 10 MB; private, internal and IP-literal hosts are refused); or use image_base64. | |
| auto_orient | No | Apply the EXIF orientation first (default true). | |
| image_base64 | No | The image as standard or url-safe base64 (at most 10 MB decoded; a data:image/...;base64, prefix is fine); or use url. |
Output Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | Only on an error result: an object {code, message}, or the reason string of an x402 PaymentRequired object. | |
| input | No | ||
| notes | No | ||
| source | No | ||
| average | No | ||
| palette | No | ||
| dominant | No | ||
| final_url | No | ||
| operation | No | ||
| source_url | No | ||
| pixels_sampled | No |