Coloropix

Generate a color palette from any image

Pick an image

+

Click or drag & drop

JPG / PNG supported

Preview

Pick an image to see the preview here

How k-means picks the "representative" colors

Coloropix doesn't count colors. It groups similar colors together and takes the center of each group. Step by step:

  • Shrink the image so its longer side is 200 pixels and collect the pixels (pixels that are more than half transparent are ignored)
  • Use k-means++ to pick starting colors that are far apart from each other — as many as the number of colors you chose
  • Assign every pixel to its nearest color, move each color to the average of its group, and repeat until assignments stop changing (up to 20 rounds)
  • Sort the groups by size and show each group's share as a percentage

Quirks worth knowing

"Nearness" is measured as straight-line distance between RGB values. That doesn't perfectly match how our eyes see color, so two colors you'd call different can merge, and occasionally the reverse.

The starting colors are chosen at random, so the same image with the same color count can produce slightly different results each time you re-extract. When you get a palette you like, copy it right away.

Choosing the color count (5–10) and the area

Fewer colors merge similar shades and keep the overall mood of the image. More colors let mid-tones and accents stand on their own — but subtle shading in the background may show up as separate swatches too. For a web palette, a practical order is: start with 5 or 6, treat high-share colors as base candidates and low-share ones as accents, and only raise the count when a color you want is buried. Press re-extract after changing the count.

If the background is dragging the palette off course, drag on the preview to box only the part you care about. With several boxes, colors are taken from all of them combined. The preview zooms to 200% for small details.

Export as a HEX list, CSS variables (--color-1 onward) or a Tailwind config — all sorted by share, largest first. The image and the results stay on your device.

Using the palette in a design

Each swatch switches its label between dark and white text based on the color's relative luminance. That's only a readability hint — the tool does not calculate contrast ratios. Before using an extracted color for text or backgrounds, check the WCAG contrast ratio (at least 4.5:1 for body text) with a dedicated checker.

Colors pulled from photos often come out muted, because lighting and shadow mix into them. For buttons or anything meant to stand out, treat the extracted color as a starting point and nudge its saturation or brightness.

FAQ

Q. What does the percentage on each swatch mean?
A. The share of pixels that fell into that color's group. If you boxed regions, it's the share within those regions.
Q. How are transparent areas in a PNG handled?
A. Pixels less than half opaque are skipped, so a cut-out image gives you a palette of the subject alone.
Q. Which images can I load?
A. JPEG, PNG or WebP, up to 20 MB each.