Design tools

Color Extractor from Image

Color Extractor from Image

Extract the dominant colours from any image and copy them as HEX, RGB or CSS variables.

About this tool

About Color Extractor from Image

Drop a photo, logo, illustration or screenshot to find its main colours. The extractor groups similar pixels with k-means clustering in the perceptual OKLab colour space, so the colours it finds match what your eye sees as the main tones rather than just the most frequent exact pixel values. You choose how many colours to extract, from 2 to 16, and see each one with its share of the image in a proportional bar. Sort them by how much they're used, by lightness or by hue. Every swatch can be copied as HEX or RGB, and the whole set exports as CSS custom properties, a Tailwind v4 @theme block, JSON or a plain HEX list. Need one exact colour instead? Click anywhere on the image to pick that pixel. Transparent areas of PNG logos are ignored, and the same image always gives the same palette. The image is analysed in your browser and never uploaded.

Built and maintained by Abhi JainUpdated

How to Extract Colours from an Image

  1. 1

    Add an image

    Drop an image or choose one, or press Try a sample image.

  2. 2

    Tune the palette

    Set the Number of colours and choose how to Sort by.

  3. 3

    Copy or export

    Copy any HEX or RGB value, click the image to pick a pixel, or export CSS, Tailwind, JSON or a HEX list.

Color Extractor from Image: questions and answers

How does the colour extractor choose colours?

It samples the image, converts pixels to OKLab and runs k-means clustering, which groups pixels into the number of colours you ask for. Each colour shown is the average of the real pixels in its group, with its share of the image.

How do I get the exact colour of one pixel?

Click the image on the left. The pixel's HEX and RGB values appear underneath, ready to copy.

Why does the palette change when I ask for more colours?

With more groups, large areas split into finer shades, so earlier colours can shift slightly. Pick the count that best describes the image.

Can I turn the palette into a full colour system?

Yes. Copy a colour into the Color Palette Generator to build harmonies and a 50–950 scale from it.

Is my image uploaded?

No. The analysis runs in your browser and the image never leaves your device.

Ready-made Color Extractor from Image presets