# agent402.tools Image Dominant Color Extractor

> agent402.tools Image Dominant Color Extractor is a paid API for AI agents from agent402.tools, paid per call via x402, $0.003/call, status unknown (last checked 2026-09-14).

Extracts the dominant colors from an image as a palette of hex values with pixel ratios using deterministic bucketed quantization.

## Facts

- Endpoint: POST https://agent402.tools/api/image-dominant-color
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-tools-image-dominant-color-extractor-188abbbc
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_95fK0NZhZ6ta4-j3upnnt

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 agent402-tools-image-dominant-color-extractor-188abbbc -d '<json body>'
```

Example prompt: Can you pull the top 3 dominant colors from this image as hex values with their pixel ratios? Here's the URL: https://example.com/photo.jpg

## When to prefer this

Use this endpoint when you need a deterministic, reproducible color palette extraction from an image — especially when you require pixel ratio weighting alongside hex codes. Preferred over ML-based palette tools when consistency across repeated calls matters, or when you want to extract design/brand colors from logos and photos without stochastic variation.

## Known failure modes

- Image URL is not publicly accessible or returns a non-200 response
- Image exceeds the 5MB size cap
- Base64 string is malformed or not a valid image
- Colors parameter is outside the 1–10 range
- Network timeout fetching the remote image
- Unsupported image format

## How this service works

Extract the dominant colors of an image as a palette of hex values with pixel ratios. Send a public image URL or a base64 image, and optionally how many colors (1-10, default 5). Deterministic bucketed quantization; transparent pixels are ignored.

## Output

A palette of hex color codes (e.g. #3A7BD5) each paired with a pixel ratio indicating how much of the image that color occupies, covering the requested number of colors (1–10, default 5). Transparent pixels are excluded from the analysis.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "url": {
   "type": "string",
   "description": "public http(s) image URL (fetched server-side, 5MB cap)"
  },
  "image": {
   "type": "string",
   "description": "alternative: base64 image, optionally a data: URL"
  },
  "colors": {
   "type": "number",
   "description": "palette size, 1-10 (default 5)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "width": 100,
  "colors": [
   {
    "hex": "#181708",
    "rgb": [
     24,
     23,
     8
    ],
    "ratio": 0.078
   }
  ],
  "height": 68,
  "sampled": 6240
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-image-dominant-color-extractor-188abbbc/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
