tools.pratyushsaxena
All tools

Color Palette from Image

Extract a clean 5-color palette from any image.

About this tool

Drop in an image and pull out the 5 dominant colors using k-means clustering. Click any color to copy its hex code. Export as CSS variables for your next project. Useful for design moodboards, web themes, and matching colors to a reference photo.

How to use it

  1. Drag an image into the dropzone (or click to choose).
  2. Five dominant colors are extracted automatically.
  3. Click any swatch to copy its hex code, or click Export CSS to download a snippet.

FAQ

How are the colors picked?+

We use the colorthief library, which clusters the image's pixels into the most distinct color groups (a variant of k-means). The output is the 5 most representative colors, not necessarily the most frequent.

Does my image leave my browser?+

No. Extraction happens locally — the image is never uploaded.

Why does my palette look slightly different each time?+

Color clustering involves a small amount of randomness in how the initial groupings are picked. The result is stable in practice but can vary by 1–2 hex points between runs.