Color Palette Extractor from Images

Upload any image and extract its dominant colors with HEX codes. Great for design inspiration, branding, and color matching.

Runs in your browser. No data leaves your device.

About this tool

Finds the dominant colors in an image with k-means clustering in RGB space. The image is drawn onto a 200x200 canvas, every 4th pixel is sampled (up to 10,000 samples, transparent pixels skipped), starting colors are spread across the image's color range (farthest-point seeding), and k-means runs for up to 10 iterations. Colors are shown sorted dark to light as HEX swatches, never repeated.

Features
  • Pick 1 to 100 colors (default 20); re-extracts as soon as the count changes
  • Palette strip plus a color card per swatch with its HEX code
  • Tap a color card to copy its HEX code; Copy all copies the whole palette
  • Copy all as a comma-separated HEX list, or send it to another tool
  • Decodes JXL and HEIC/HEIF with WASM
How to use it
  1. Drop an image or click to browse
  2. Choose how many colors to extract
  3. Copy single HEX codes or the whole list
Inputs
  • image/* plus JXL and HEIC/HEIF; one image; no size cap
Outputs
  • Uppercase HEX codes (for example #1A2B3C), copied to the clipboard
  • No file download
Limits and notes
  • The image is squashed to 200x200 before sampling, so results are approximate
  • Returns fewer colors than requested when the image has fewer distinct colors; close (but not identical) shades can still appear at high counts
  • Pixels at or below 50% opacity are ignored
  • Sorted by brightness, not by how much of the image each color covers
  • Nothing is stored locally

Frequently Asked Questions

How does the Color Palette Extractor work?

Your image is decoded to raw RGBA pixel data. The tool samples every 4th pixel for performance, skips transparent pixels, spreads the starting colors across the image's color range, then runs k-means clustering for up to 10 iterations to group similar colors. Each pixel is assigned to the nearest centroid by Euclidean distance in RGB color space, and centroids are recalculated as the average of their cluster. The final centroids become your extracted palette colors.

Can I copy the color codes?

Yes. Tap a color card to copy its HEX code, and Copy all at the top copies the whole palette as a comma-separated list of HEX codes.

How many colors can I extract?

Choose anywhere from 1 to 100 colors from the Colors dropdown; the default is 20. The palette updates as soon as you change the number, and colors are shown sorted from dark to light.