Color Picker & Palette Extractor
Extract a colour palette from any image, eyedrop exact pixels, export CSS variables, Tailwind or JSON, and check WCAG contrast — all in the browser.
Runs entirely in your browser — nothing is uploadedDrop a file or click to browse
PNG, JPEG, WebP, AVIF, GIF, BMP or SVG — read on your device, never uploadedAdd a colour by value
Contrast (WCAG 2.2)
18.88:1Large text, 24px
Normal body text at 16 pixels.
Small print at 13 pixels.
Best plain text on this background is #000000 at 21.00:1.
Ratios are shown truncated, never rounded — 4.499:1 would read as “4.50” and look like a pass it is not. Large text means 18pt (24px) or 14pt (18.66px) bold and heavier.
Export
0 coloursAbout the Color Picker & Palette Extractor
Drop in a photo, a screenshot, a logo or a UI mock and get the colours out of it. The palette is built by median cut — the histogram of the image is split repeatedly along its longest colour axis until it holds the number of groups you asked for, and each swatch is the mean of the real pixels in its group. Every colour comes with its hex, rgb() and hsl() values, its share of the sampled pixels, and a one-click copy. On top of that there is an eyedropper on the preview for reading a single pixel, a box for typing colours in by hand, and export as CSS custom properties, a Tailwind v4 @theme block, a tailwind.config.js colours object, JSON, or a plain list.
The first thing that separates a useful palette from a decorative one is knowing when to stop. Ask most extractors for eight colours from a two-tone logo and you get eight: the two real ones, plus six shades of the same blue a step apart, presented with the same confidence. That is not a palette, it is padding, and it wastes your time when you paste it into a design token file. Here the count you choose is a ceiling, not a promise — when no group of colours can be split into two the eye could tell apart, the split stops, output colours closer than a small threshold are folded together, and the tool says in plain words how many distinct regions it actually found.
The second thing is not inventing colours that were never in the picture. Palette extractors shrink an image before analysing it, because nobody needs fifty megapixels to find six colours. The usual shrink is a smooth, averaging one — and averaging a red pixel next to a blue one produces a purple that appears nowhere in the file. On a striped shirt, a dithered GIF or a chart with thin lines, that invented colour can be dominant enough to reach the palette. This tool samples with nearest-neighbour instead, so every pixel it counts is a pixel that genuinely exists in your image. The eyedropper goes further: it reads an 11×11 window from the decoded image at its own resolution, never from the scaled-down preview on screen, so the hex you copy is a real pixel value rather than a resampled approximation of one. Transparency is treated the same way — a PNG's transparent area still stores RGB underneath the zero alpha, usually black or white, and counting it would put a colour in the palette that nobody can see, so pixels below the alpha threshold are excluded and reported separately.
The contrast checker exists because picking colours and checking they are legible are the same job. Any two colours in the palette — or two you type — get a WCAG ratio and a verdict for every threshold that matters: 4.5:1 for normal text, 3:1 for large text and for UI components and graphics under 1.4.11, and 7:1 for AAA. The displayed number is truncated, never rounded: 4.499:1 rounds to "4.50" and reads as a pass beside a verdict that says it fails, so what you see can never be kinder than the result. Ratios also need two solid colours — if you paste an rgba() value the alpha is dropped, the numbers describe the opaque version, and you are told, because the real ratio depends on whatever sits behind the translucent layer.
None of this needs a server, and that matters more than it sounds. The images people run through a colour picker are brand assets under NDA, product screenshots with customer names in them, unreleased design comps, and photographs of their own family. Everything here happens through the Canvas API on your own machine: the file is read locally, decoded locally, sampled locally, and never sent anywhere. There is nothing to upload to — this site is static hosting with no backend. Load the page, turn off your Wi-Fi, and the tool still works.
Everything runs inside your browser using standard web APIs. Your data is never uploaded, never stored on a server, and never leaves your device — you can confirm that by opening your browser devtools Network tab, or by switching off your Wi-Fi and using the tool offline.
Frequently asked questions
Why did I get four colours when I asked for twelve?
Because the image only holds four regions the algorithm can tell apart at the sampled resolution. Median cut splits groups of colour until nothing left is divisible; a flat two-tone logo genuinely has two colours, and a duotone photo has a narrow ramp. Returning twelve would mean handing back eight near-identical duplicates that look like data but are noise. The tool tells you when it stopped short and why.
Are the palette colours exact pixels from my image?
Not quite — each swatch is the mean of all the real pixels grouped into it, so it represents a neighbourhood rather than one specific pixel. That is what you want for a palette. If you need a colour that is exactly present in the file, use the eyedropper instead: it reads a single pixel of the decoded image and reports it byte for byte.
Does the eyedropper sample the shrunken preview or the real image?
The real image. Anything wider or taller than 1600px is displayed scaled down so it fits the page, but sampling is done by blitting an 11×11 window out of the decoded image at its own resolution, with interpolation switched off. The panel tells you which case you are in. On a large photo one screen pixel covers several image pixels, so the magnifier is there to let you land on the one you meant.
Why does another tool give a different palette from the same image?
Because quantisation is a choice, not a measurement. Median cut, octree and k-means all cluster differently, tools disagree about whether to work in RGB or a perceptual space, and they sample different numbers of pixels. There is no single correct palette for an image — there is only a defensible one, which is why this tool tells you how many pixels it sampled and what share each colour covers.
Can I check contrast without loading an image?
Yes. The contrast panel is always available: type or paste any two colours as hex, rgb(), hsl(), or one of the basic colour names, or use the native colour swatches. You can also build a palette entirely by hand with the "add a colour by value" box and export it, with no image involved at all.
Why was my iPhone photo refused?
HEIC and HEIF are the formats iPhones shoot by default, and no browser can decode them onto a canvas. Rather than showing a blank or a black palette, the file is identified from its bytes and refused with an explanation. Export a JPEG first — on iPhone, Settings → Camera → Formats → Most Compatible; on a Mac, open it in Preview and use File → Export with Format: JPEG. TIFF and JPEG 2000 hit the same wall outside Safari.
What happens with a GIF, a video or an SVG?
An animated GIF, WebP or AVIF decodes to its first frame only, so the palette describes that frame and you are warned. A video file is identified and refused — it is not a still image. An SVG has no pixels at all until it is drawn, so it is rasterised at up to 1600px first and the palette comes from that rendering, which means gradients and anti-aliased edges contribute colours that appear nowhere in the markup. That is stated on screen too.
Does it work offline?
Yes. Once the page has loaded, nothing else is fetched. You can disconnect from the network and keep extracting palettes, and that is the simplest way to confirm your images are not going anywhere.