Image Effects
By ToolzBank Team•
4 min read
•Friday, November 13, 2026

Extract a Color Palette from an Image (HEX, CSS, Tailwind)

Pull the dominant colors out of any photo or screenshot, grab exact HEX codes with the eyedropper, and export the palette as CSS, SCSS, Tailwind or JSON.

#color palette from image#extract colors from image#get hex code from image#image color picker#dominant color finder#tailwind color palette

A client sends a photo of their shopfront and says, "we want the website to feel like this." Or you've found an illustration whose colors just work and you want to know why. Either way you need actual values, not "a sort of dusty teal."

The image color palette extractor turns a picture into those values. It finds the colors that cover the most of the image, shows each as HEX, RGB and HSL, and exports the set as code you can paste straight into a project. The image is read in your browser and isn't uploaded.

How the colors get picked

The tool makes a small working copy of your image, about 180 px on the longest side, ignores transparent pixels and groups the rest with k-means clustering. Each group becomes one swatch, and the swatches are sorted by how much of the picture they cover. The same image and color count give the same palette every time. If you'd like to see a different grouping, the Shuffle button re-runs the clustering from a new starting point.

Something that surprises people: the dominant colors are often the dull ones. A photo of a red bike against a grey street can give you four greys and one red, because the street covers more of the frame. That's working as intended, and it's exactly why there's an eyedropper.

Getting a palette, step by step

  1. Open the color palette tool and drop in a photo, logo, illustration or screenshot, or paste one with Ctrl+V (Cmd+V on a Mac).
  2. Use the slider to choose anywhere from 2 to 12 colors. Five or six is a sensible first try.
  3. Click a swatch to copy its HEX code. To grab one particular spot, like the red of that bike, click directly on the image and the exact pixel's values appear with a copy button.
  4. Open the export panel and copy the palette as CSS custom properties, SCSS variables, a Tailwind colors object or JSON, or download it as a PNG.

How many colors should you ask for?

  • Logos and flat graphics: set the count to about the number of colors you can actually see. Higher than that and one flat color gets split into near-identical shades.
  • Photos: 5 to 8 usually captures the mood. At 12 you'll start getting three versions of the same sky.
  • Interface screenshots: the white or dark background will dominate whatever you do. Use the eyedropper for buttons, links and accents.

Turning raw colors into something usable

An extracted palette is raw material, not a finished design system. A few checks now save rework later:

  • Test contrast before putting text on any swatch. Colors pulled from photos are often mid-tones that look lovely as blocks and fail badly as text. The color converter has a contrast check, and also translates a HEX value into RGB, HSL, HSV or CMYK.
  • Expect compression noise. JPEGs contain small color variations, so an eyedropper click on a "flat" area can land a value or two away from the official brand color. If exactness matters, ask for the brand guide.
  • Rename the variables. The export uses generic names like --color-1. Change them to something meaningful, such as primary or surface, before they spread through your code.

When it fits, and when it doesn't

It's ideal for mood boards, matching a slide deck to a hero photo, picking accent colors from product shots, and finding the HEX value of something in a screenshot. Designers use it to study a palette they admire; developers use it to get a quick theme going for a prototype.

It isn't a source of official brand colors, and it only gives screen values. It won't produce Pantone references, and screens and printers render color differently, so anything headed for print should be checked against a physical proof.

Frequently asked questions

How do I find the HEX code of one spot in a picture?

Upload the image and click that spot; the tool shows the exact pixel's HEX, RGB and HSL values with a copy button.

Why are the main colors in my palette so dull?

Swatches are ranked by how much of the image they cover, so large backgrounds tend to win; use the eyedropper to capture small accent colors.