UtilityNest

Color Palette Extractor

Upload a photo, logo or screenshot to see its main colors and how much of the image each one covers. Click the image to pick exact colors, then copy the codes you need.

Tip: you can also paste an image with Ctrl+V (Cmd+V on Mac).

How to use Color Palette Extractor

  1. 1Drop an image or paste a screenshot with Ctrl+V. The palette appears right away.
  2. 2Use the slider to choose between 2 and 16 colors.
  3. 3Click anywhere on the image to add the exact pixel color to your picked colors.
  4. 4Click a swatch to copy its HEX code, or click the RGB or HSL line to copy that value.
  5. 5Copy the whole palette as CSS, SCSS, Tailwind, JSON or a HEX list, or download it as a PNG.

How the colors are found

The tool samples the image, splits its colors into groups with a median cut method, and then refines each group with a few rounds of k-means clustering. The result is a palette of colors that really appear in the image, sorted by how much area they cover. The proportion bar shows these shares at a glance. Fully transparent pixels are ignored.

Uses for designers and developers

You can build a website or brand palette from a photo or mood board, or find the exact colors of a logo or screenshot with the eyedropper, and then paste ready-made :root CSS variables, SCSS variables or a Tailwind color block into your project.

Accuracy notes

Dominant colors are averages of similar pixels, so a gradient or a photo with soft lighting gives blended tones rather than one exact pixel value. Use the eyedropper when you need a specific spot. The image is analyzed in your browser and is not uploaded.

Tested on a screenshot and a photo

App screenshot (flat colors): with 8 colors the palette returned the interface colors exactly: white at 60.6%, a light grey sidebar #F3F4F6 at 15.0%, and the blue header #2563EB at 6.5%, the same values used to draw it. The dark body text, drawn as #111827, came out as #39404E at 1.6%, because thin anti-aliased letters blend with the white around them.

Street photo: the 8 colors were mostly muted greys and browns from the road and buildings, each 10 to 16% of the image. The bright blue of the bus, the color most people would call the photo's accent, appeared only as #085DA1 at 5.3%.

Two takeaways: dominant colors are ranked by area, so backgrounds win; and for text or thin lines, click a thick part with the eyedropper instead of trusting the palette.

Getting the accent colors, not just the background

Raise the number of colors to 12 or 16, and small accents then get their own swatch. It also helps to crop the image to the area you care about first, for example the product without the table. For logos and brand marks, use the eyedropper and click the middle of a solid area, not an edge.

Before exporting, remove swatches you do not need, so the CSS variables are numbered in a useful order.

Check contrast before using colors for text

A palette pulled from a photo often contains pairs that look good together but are hard to read as text on background. The WCAG accessibility guideline asks for a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text (W3C Understanding Contrast (Minimum), checked October 2026). This tool does not calculate contrast, so test your chosen text and background pair in a contrast checker before building a page on it.

The exports name colors by position: --color-1 in CSS, $color-1 in SCSS, and 100, 200, 300 keys in the Tailwind block. Rename them to roles such as primary or surface in your project.

Choosing how many colours to ask for

The slider runs from 2 to 16 colours, with 8 as the default, and the number changes what you get more than you might expect. With a low count, each swatch is an average of a large group of pixels, so a photo's colours come out muddier and an accent that covers a small area tends to vanish into its neighbour. With a high count, large areas such as sky or a white page split into several close shades before small accents get their own swatch.

A practical approach: for a logo or flat illustration, set the count to roughly the number of colours you can see, then go one higher. For a photo, try 8, then 12, and keep the swatches that stay stable between the two runs. Click a swatch to copy its HEX code; the RGB and HSL values underneath copy on click as well.

Frequently asked questions

How do I get the HEX code of a color in an image?

Upload the image and click the spot you want. The exact color is added to Picked colors, and clicking its swatch copies the HEX code.

How many colors can I extract?

From 2 to 16. Images with only a few distinct colors may return fewer.

What do the percentages mean?

Each percentage is the share of the image's visible pixels closest to that color.

Can I export the palette for Tailwind CSS?

Yes. Choose Tailwind in the export box and click Copy code.

Is my image uploaded?

No. The colors are calculated on your device.

Why is my text color lighter in the palette than in the design?

Thin letters are anti-aliased, so their edge pixels mix with the background and the average becomes lighter. Our #111827 text came out as #39404E. Use the eyedropper on the thickest part of a letter.

Why is the brightest color in my photo missing?

Colors are ranked by how much area they cover. A small bright object can be merged into a nearby group. Raise the number of colors or crop to the object.

Does the tool check text contrast?

No. Check the pair you plan to use against WCAG's 4.5:1 minimum for normal text in a contrast checker.