Palette from Image
Extract the dominant colors from any photo.
How to use the Palette from Image
- 1Drop a photo.
- 2Choose how many colors to extract, or pick colors with the eyedropper.
- 3Copy the palette as HEX, CSS or Tailwind.
About Palette from Image
Palette from Image extracts the dominant colors from a photo and turns them into a ready-to-use color palette. Drop an image and choose between 3 and 12 colors; the tool groups similar pixels using k-means clustering in a perceptual color space and shows each color with its share of the image. Sort the palette by share, hue or lightness, try another grouping, remove colors you don't need, or add exact colors with the eyedropper.
Selecting a color shows its HEX, RGB, HSL and OKLCH values and checks the contrast ratio against white and black text with WCAG ratings. The whole palette can be copied as a list of HEX codes, saved as a PNG swatch strip, or exported as CSS custom properties, a Tailwind @theme block, SCSS variables or JSON, with a name prefix of your choice.
Designers use this color extractor to build a color scheme from a mood photo, web developers pick brand colors from a logo or screenshot, and illustrators and crafters find matching image colors for their next project.
Frequently asked questions
How are the dominant colors of an image found?
The tool samples the image and groups pixels with similar colors into clusters with the k-means algorithm. Each cluster becomes one palette color, and its share is the portion of sampled pixels it represents.
Why does the palette change when I try another grouping?
K-means starts from random initial colors, and different starting points can lead to slightly different clusters, especially in images with many similar shades. Trying another grouping lets you pick the result that looks best.
What do the AA and AAA contrast ratings mean?
They come from the WCAG accessibility guidelines. Normal text needs a contrast ratio of at least 4.5:1 for AA and 7:1 for AAA, while large text needs 3:1 for AA. Colors below 3:1 are not readable as text.
How do I use the palette in Tailwind CSS?
Choose the Tailwind export and paste the @theme block into your CSS. Tailwind v4 then turns each --color-* variable into utilities; with the prefix brand you get classes such as bg-brand-1 or text-brand-2.
More in Image Tools
Resize images by pixels, percentage or preset sizes, in bulk.
Shrink JPG, PNG and WebP files while keeping them sharp.
Convert JPG, PNG, WebP, AVIF and more to PNG, JPG, WebP, AVIF or ICO.