# x402 Image Tools – Color Extraction

> x402 Image Tools – Color Extraction is a paid API for AI agents from image.kagurazaka.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-29).

Extracts dominant colors and average color from an image URL, returning hex codes, RGB values, and percentage shares for palette and theming use.

## Facts

- Endpoint: GET https://image.kagurazaka.dev/v1/colors?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-image-tools-color-extraction-b23afb38
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Oon27DbvVf_THUKqWmOW-

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 x402-image-tools-color-extraction-b23afb38
```

Example prompt: Can you extract the top 5 dominant colors from this image — https://example.com/photo.jpg — and give me each one as a hex code, RGB value, and what percentage of the image it covers, plus the overall average color?

## When to prefer this

Choose this endpoint when you need color palette data from an existing image at a URL — dominant colors with shares, RGB, hex, and average color — for theming, design tooling, visual search, or palette generation. It supports a wide range of formats (JPEG, PNG, WebP, AVIF, GIF, TIFF, SVG) up to 20 MB, and returns a configurable number of colors (1–10). Prefer this over generic image analysis APIs when you specifically need structured color breakdowns with percentage shares rather than object detection or captioning.

## Known failure modes

- Invalid or unreachable image URL returns an error
- Image exceeds 20 MB or 40 megapixel limit — request rejected
- Unsupported image format (non-JPEG/PNG/WebP/AVIF/GIF/TIFF/SVG) returns an error
- count parameter outside 1–10 range may return a validation error
- Payment not provided or insufficient USDC balance — 402 Payment Required

## How this service works

The dominant colors of an image with their share of it, and its average color, as hex and RGB, for palettes, theming and search.

## Output

A JSON object with a 'colors' array (each entry has 'hex', 'rgb', and 'share' fields indicating the color's hex code, RGB triple, and fractional share of the image) and an 'average' field containing the overall average color as a hex string.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "url"
     ],
     "properties": {
      "url": {
       "type": "string",
       "description": "https URL of a JPEG, PNG, WebP, AVIF, GIF, TIFF or SVG image (up to 20 MB, 40 megapixels)"
      },
      "count": {
       "type": "integer",
       "description": "how many colors (1-10, default 5)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "colors": {},
      "average": {}
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "colors": [
   {
    "hex": "#2f2a22",
    "rgb": [
     47,
     42,
     34
    ],
    "share": 0.31
   }
  ],
  "average": "#7a6b55"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-image-tools-color-extraction-b23afb38/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from image.kagurazaka.dev](https://www.zero.xyz/host/image.kagurazaka.dev/llms.txt)
