Skip to content

Color Palette from Image: Extract Colors from a Photo

Extract the dominant colors from any image as a palette with HEX and RGB codes and their share of the picture, pick exact pixel colors, and export CSS variables, Tailwind or JSON.

Drop an image here, paste from the clipboard, or

JPG, PNG, WebP, GIF, BMP or SVG. Files never leave your browser.

How to get a color palette from an image

  1. Drop a photo, illustration or screenshot.
  2. Choose how many colors you want (2–12). The palette updates instantly.
  3. Click a color to copy its HEX code, or click anywhere on the image to pick that exact pixel.
  4. Export the palette as CSS custom properties, a Tailwind color object or JSON.

How the colors are found

The image is sampled and its pixels are grouped with k-means clustering: similar colors are averaged together, and each group becomes one palette color. The percentage shows how much of the image each color covers. Transparent pixels are ignored. Sort by share to see the dominant colors first, or by hue for a rainbow order.

Using the palette in a design

  • Use the most common, calm color for backgrounds and the rarest, most saturated one as an accent.
  • Build full scales from each color with the tints and shades generator.
  • Check text and background pairs with the contrast checker before using them.

All processing happens in your browser. Your images are never uploaded to a server, so the tool works with private photos and keeps working offline once the page has loaded.

More image tools