# Color Palette from Image

> Drop any image and instantly get its dominant colors (Hex, RGB, OKLCH) with WCAG contrast hints. Runs in your browser. No upload, no signup, no ads.

Free color palette extractor. Drop, paste, or upload any image and get its 3 to 9 most dominant colors in seconds (Hex, RGB, and OKLCH), each with WCAG contrast ratios against white and black. Runs entirely in your browser. No upload, no signup, no ads.

## Command line (recommended for agents)

npx @brandstack/cli color-palette-from-image <image> [--colors 3|5|7|9] [--format hex|rgb|oklch] [--json] — offline, no signup; same seeded k-means as the website, so the same image gives the same palette.

The CLI runs the same engine as this page — same logic, same output contract — with no browser and no account. Browser automation below is the fallback.

## How to use it

1. Agents: run `npx @brandstack/cli color-palette-from-image ./logo.png --json` and read the palette from stdout. No browser, no network needed after install.
2. In the browser: open the tool — everything runs client-side; the image never leaves the browser. Attach an image to the file input (`page.locator('input[type="file"]').setInputFiles(...)`), or drag, paste, or click to upload.
3. Pick how many colors to extract (3, 5, 7, or 9) and the copy format (Hex, RGB, or OKLCH).
4. Click any swatch to copy the selected format, or read the values straight from the swatch labels.

## Output

3 to 9 dominant colors, each with Hex, RGB, and OKLCH values and WCAG contrast ratios against white and black. Deterministic: the same image always yields the same palette. In the browser, values are plain text in the DOM, so an agent can read them without clicking.

## Links

- Use the tool: https://www.brandstack.dev/tools/color-palette-from-image
- All free tools: https://www.brandstack.dev/tools (markdown: https://www.brandstack.dev/tools.md)
- Agent index: https://www.brandstack.dev/llms.txt

Color Palette from Image is a free tool by Brand Stack, the AI photo studio for
product marketing. No ads, no signup. Start free: https://www.brandstack.dev/sign-up
