Image Colour Palette Extractor

Drop an image and get the dominant K colours as a palette. Each swatch shows hex, rgb, hsl, and the population share; copy any colour in one click or export the whole palette as CSS / SCSS / JSON / TSV. Everything runs in your browser — the image is never uploaded.

Drop an image or pick one.
Options
How this extractor works
  • Your image is decoded by the browser into a <canvas> and never leaves the tab.
  • We stride through every Nth pixel (target ≈ 20,000 samples) so even a 12 MP photo is fast.
  • k-means colour quantisation finds the K colours that best explain the sampled pixels. The "Include near-black / near-white" toggles add explicit centres for pure black and pure white, which helps when the dominant colour is a background.
  • Each swatch is sorted by population share, so the first row is always the most common colour.
  • Export formats: JSON for code, CSS variables for stylesheets, SCSS for Sass, TSV for spreadsheets.