Get a colour palette from an image
Find the main colours of a photo or logo in your browser, with hex and RGB values and a copy as CSS variables or JSON. Nothing is uploaded.
Colour palette from image in three steps
A palette taken from a photo is a quick way to match a slide, a poster or a website to a picture you already have. This page lists the main colours of any picture, largest share first, with the hex value, the RGB value and the share of the picture each one covers.
How to use it
Choose a picture and the colours appear straight away. Six is the starting number; choose from four to twelve. Fewer colours give the broad areas of the picture, such as sky, grass and skin. More colours pick out smaller details, such as a red jacket or a yellow sign. Each colour has its own copy button for its hex value.
Below the colours, the whole palette is written out as text. Choose CSS variables to paste into a stylesheet, JSON for a script or a design token file, or plain hex values, one a line, for a design tool. Copy it, or download it as a file.
How the colours are found
The picture is drawn at 200 pixels on its long side first. That keeps the work small for a large photo and blends away single stray pixels that would otherwise earn a colour of their own. The pixels are then grouped by median cut: the group with the most pixels and the widest spread is split in two at its middle value, along the colour channel where it varies most, until there are as many groups as colours asked for. Each colour shown is the average of one group, and its share is how much of the picture that group covers.
Two groups can average to the same colour on a flat graphic. They are shown once, with their shares added together, so a palette can come back shorter than the number chosen.
What it will not do
It lists the colours in the picture; it does not invent a matching scheme around them. A photo taken in warm light gives warm colours, even if the object was white. For checking whether two of the colours can sit together as text and background, use the Contrast checker, and to turn a hex value into HSL or OKLCH, the Colour converter.
Nothing leaves the device
The picture is opened and measured inside your browser tab. There is no upload, no account and no copy kept anywhere, so an unreleased product shot or a client’s logo stays with you.
- 1
Choose a photo, logo or screenshot
- 2
Pick how many colours to list
- 3
Copy a hex value, or the whole palette as CSS or JSON
Frequently asked questions
How are the colours chosen?
By median cut. The picture's pixels are split again and again across the colour channel where they differ most, until there are as many groups as colours asked for, and each group's average is one colour.
Why does the same photo always give the same palette?
Median cut has no random starting point, unlike k-means, so the same picture and the same number of colours give the same list every time.
Are transparent areas counted?
No. Pixels less than half opaque are left out, so the clear background of a logo is not listed as its main colour.
Is my image uploaded?
No. The picture is read and the colours are worked out in your browser, and nothing leaves your device.