Skip to main content

Image Color Palette Generator

Pull the main colours out of a photo or artwork, see how much of it each one covers, and export the palette for CSS, Tailwind, JSON or design apps.

Upload an image to get its colour palette

Drag and drop files here, or click to browse

Choose file

or paste an image (Ctrl+V)

Processed in your browser, never uploaded. You keep full ownership of your images. View license

How to make a palette

  1. Open an image. Its main colours appear under it with their share of the picture.
  2. Choose how many colours you want, from 2 to 16, and how to order them: by amount, lightness or hue.
  3. Turn on Ignore white or Ignore black when a background or border takes over.
  4. Click a swatch to copy its HEX code, open Colour for other formats, or use Export.

How the colours are chosen

Pixels are grouped by how similar they look, using k-means clustering in the OKLab colour space, where distances match what people see. Each group is then shown by a colour that really occurs in the image, taken from its most common shades, rather than by a blend that may not exist anywhere in it. Flat graphics therefore give their exact colours.

The first colour is the most common one; after that, colours that differ clearly from those already chosen get priority, so a small accent has a good chance of appearing. Small images are read in full and large ones are sampled evenly. Transparent pixels are left out. The same image and settings always give the same palette.

Export formats

  • Copy: a HEX list, CSS custom properties, Tailwind colours or JSON.
  • PNG: a picture of the swatches with their codes and shares.
  • CSS and JSON files. The JSON includes HEX, RGB and the share of each colour.
  • GPL: a palette file that GIMP and Inkscape can load.

Making a palette usable

An extracted palette is a starting point. Before using it for text or buttons, check the contrast shown for each colour on white and on black: colours that look distinct in a photo can be too close in lightness to read. A common approach is one dark colour for text, one light colour for backgrounds, and the stronger colours for accents. To read one exact spot, use the Image Color Picker.

Where the processing happens

The palette is computed in your browser and the image is not uploaded. The site itself loads analytics and advertising scripts, described in the Privacy Policy.

Questions about this tool

I want colours for my website that match a photo. How do I get them?

Open the photo, choose how many colours you want and open Export. Copy the CSS variables or Tailwind colours, or click a swatch for its HEX code.

A bright colour in my photo is missing from the palette. Why?

It may cover too little of the picture. Raise the number of colours, or use the Image Color Picker to read that exact spot.

Why do I get fewer colours than I asked for?

The image does not contain that many clearly different colours, or Ignore white and Ignore black left some out.

What does the percentage mean?

The share of the picture that is closest to that colour, leaving out transparent pixels and anything you chose to ignore.

Can I use these colours for text?

Check the contrast first, under Colour. Normal text needs at least 4.5:1 against its background for WCAG AA.

Will I get the same palette if I run it again?

Yes. The same image and settings always give the same palette.