---
title: Extract Image Color Palette API
slug: extract-image-palette
url: https://apyhub.com/dosvak/service/extract-image-palette
provider: Dosvak LLC
categories: [Image Processing]
tags: [image-palette, color-extraction, dominant-color, image-analysis, rgb, hex-colors]
auth: api_key
---

# Extract Image Color Palette API

Extract a dominant hex colour and a sorted palette from any uploaded image. Built for theme generation, design tooling, and image analysis.

## Endpoints

| Method | URL | Description | Atoms |
| --- | --- | --- | --- |
| POST | `https://api.eu.apyhub.com/dosvak/extract-image-palette` | What it does Extracts a colour palette from an uploaded image and returns the dominant colour plus… | 100 |

## Examples

### Extract dominant colour and palette from an image

#### Quickstart

Upload an image to extract its color palette.

```bash
curl -X POST "https://api.eu.apyhub.com/dosvak/extract-image-palette" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/image.jpg"
```

#### What you'll get back

Returns a JSON object with three top-level fields: `palette` is an array of HEX color strings sorted by dominance, `dominant` is the HEX color of the most dominant pixel cluster, and `rgb_palette` is an array of RGB objects with `r`, `g`, and `b` integer values.

```json
{
  "palette": ["#1f2937", "#f59e0b", "#e5e7eb"],
  "dominant": "#1f2937",
  "rgb_palette": [
    { "r": 31, "g": 41, "b": 55 },
    { "r": 245, "g": 158, "b": 11 },
    { "r": 229, "g": 231, "b": 235 }
  ]
}
```

## About

## What it does
Image Palette Extractor reads an image file and returns the dominant colour along with a palette of up to 20 colours. Send an image in `file`, and optionally set `colors` to control how many palette entries you want back.

The response includes `dominant` as a hex colour for the most dominant pixel cluster, `palette` as hex colours sorted by dominance, and `rgb_palette` as the same colours broken out into `r`, `g`, and `b` values. That makes it easy to plug the output into design systems, theme builders, image analysis workflows, or UI previews that need colours in both CSS-friendly and RGB formats.

Use Image Palette Extractor when you need to derive a brand palette from an uploaded asset, generate accent colours for a product card, or inspect an image before applying a matching background or border colour. The only required input is the image itself, so it fits cleanly into upload flows and asset-processing pipelines.

## Usage

Base URL: `https://api.eu.apyhub.com` (default region — see
`GET https://apyhub.com/api/public/regions` for the rest).

Authenticate with an ApyHub API key in the `apy-token` header.
Full docs and a live playground: https://apyhub.com/dosvak/service/extract-image-palette
