{"uid":"cap_Oon27DbvVf_THUKqWmOW-","slug":"x402-image-tools-color-extraction-b23afb38","name":"x402 Image Tools – Color Extraction","description":"The dominant colors of an image with their share of it, and its average color, as hex and RGB, for palettes, theming and search.","url":"https://image.kagurazaka.dev/v1/colors?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"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":{}}}}}}},"responseSchema":{"type":"json","example":{"colors":[{"hex":"#2f2a22","rgb":[47,42,34],"share":0.31}],"average":"#7a6b55"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_5u4JvK2Diu4e1-9AaS6CL","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Extracts dominant colors and average color from an image URL, returning hex codes, RGB values, and percentage shares for palette and theming use.","exampleAgentPrompt":"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?","exampleUseCases":[{"title":"Brand palette extraction from logo","prompt":"Pull the dominant colors from our logo at https://mybrand.com/logo.png — give me the top 3 colors as hex codes with their share of the image, so I can build a consistent color palette for our website."},{"title":"Dynamic UI theming from product photo","prompt":"I have a product image at https://shop.example.com/jacket.jpg — extract the top 7 dominant colors with their RGB values and shares so I can automatically theme the product page to match."},{"title":"Image search by color similarity","prompt":"Analyze the colors in https://gallery.example.com/sunset.webp and get me the average color and the 5 dominant colors with hex codes — I want to use them to find visually similar images in our catalog."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-29T12:35:50.116Z","isFirstParty":false,"canonicalSlug":"x402-image-tools-color-extraction-b23afb38"}