# Bacon Services: Image Palette Extractor

> Bacon Services: Image Palette Extractor is a paid API for AI agents from baconservices.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-29).

Extracts the dominant color palette from an image, returning up to 12 colors as hex values with their proportional share and neutral classification.

## Facts

- Endpoint: POST https://baconservices.com/api/agent-commerce/v1/capabilities/image-palette/execute?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/bacon-services-image-palette-extractor-aeda5d94
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_hLDEPeJPZzthrXnyuWEXC

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability bacon-services-image-palette-extractor-aeda5d94 -d '<json body>'
```

Example prompt: Can you extract the top 5 dominant colors from this product photo — https://example.com/product.jpg — and tell me each one as a hex code with its share of the image? Skip neutrals so I only see the real colors.

## When to prefer this

Choose this endpoint when you need to programmatically extract the dominant color palette from any image — particularly useful for brand auditing, product catalog enrichment, design system generation, or UI theming. It is lightweight, fast, and cost-effective at $0.01 per call. Prefer it over full computer-vision APIs when color distribution is the only signal needed, rather than object detection or semantic understanding. The neutral-filtering option makes it especially useful when you want to isolate chromatic brand colors from photographic backgrounds.

## Known failure modes

- Image URL is not publicly accessible or returns a non-200 response — endpoint cannot fetch image
- Image format is not PNG, JPEG, or WebP — unsupported format error
- base64 string is malformed or does not decode to a valid image — decoding error
- count parameter outside the 1–12 range — validation error
- Both image_url and image_base64 provided or neither provided — ambiguous or missing input error
- Network timeout fetching remote image URL
- Image is extremely small (e.g. 1x1 pixel) — may return fewer colors than requested

## How this service works

Image Palette: Returns the colours one image is mostly made of, as JSON: up to count colours, most common first, each as a hex value with its share of the image (0 to 1) and whether it is a neutral (near white, near black or grey). The image is sampled at up to 160 pixels on its longest side, so small details do not count.

## Output

A JSON array of up to the requested number of color entries, sorted by prevalence, each containing: a hex color code (e.g. '#3a7bd5'), a share value between 0 and 1 indicating what fraction of the image that color represents, and a boolean indicating whether the color is considered neutral (near-white, near-black, or grey). The image is internally downsampled to 160px on its longest side before analysis.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "count": {
   "type": "integer",
   "default": 6,
   "maximum": 12,
   "minimum": 1,
   "description": "The most colours to return."
  },
  "image_url": {
   "type": "string",
   "format": "uri",
   "description": "A public https URL of a PNG, JPEG or WebP image."
  },
  "image_base64": {
   "type": "string",
   "description": "The image bytes, base64-encoded.",
   "contentEncoding": "base64"
  },
  "include_neutrals": {
   "type": "boolean",
   "default": true,
   "description": "Count near-whites, near-blacks and greys too. With false, shares are of the coloured part of the image only."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/bacon-services-image-palette-extractor-aeda5d94/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from baconservices.com](https://www.zero.xyz/host/baconservices.com/llms.txt)
