Colour Palette from Image
Colour Palette from Image finds the main colours in a photo, logo or screenshot and gives you their HEX codes, how much of the image each one covers, and code to paste into CSS, SCSS or JSON. Your image is read on your device and is never uploaded.
Choose an image to get its main colours.
Your image is read on this device and never uploaded.
What is the Colour Palette from Image?
Colour Palette from Image is a palette extractor. It reads every pixel of your picture, or an even sample of a very large one, and groups similar colours together. It first splits the colours with the median cut method, then refines the groups with k-means so that each colour is the average of the pixels closest to it and its percentage is the real share of the picture. You choose 3 to 12 colours, sort them by share, hue or lightness, and leave out a plain white or black background. Designers use it to build a brand palette from a logo or a mood photo, and developers use it to turn a screenshot into CSS variables.
Who it is for: For designers and illustrators, web developers, small business owners matching a brand, social media creators, and students working on art or design projects.
How to use the Colour Palette from Image
- Choose, drop or paste an image.
- Pick how many colours you want and how to order them.
- Turn on Ignore white or black background if the picture has one.
- Tap a colour to copy its HEX code, or copy the whole palette as code.
Why use it
- Real sharesEach colour shows how much of the image it covers, so you know the main colour from the accents.
- Ready to pasteCopy the palette as CSS variables, SCSS, JSON or a plain HEX list.
- Ignore backgroundsLeave out white or black backgrounds so logos and product shots give useful colours.
- PrivateThe image never leaves your device, so drafts and client work stay private.
At a glance
- What you put in
- One image (JPG, PNG, WebP, GIF, AVIF, BMP or HEIC, up to 50 MB), number of colours (3 to 12), order, background options and code format
- What you get
- 3 to 12 colours with HEX codes and the share of the image each covers, a colour bar, code as CSS variables, SCSS, JSON or HEX list, and a PNG of the palette
- Limits
- Images over 4 megapixels are scaled down first, which keeps the main colours; transparent pixels are skipped; colours are read as sRGB; animated GIFs use the first frame
- Privacy
- Runs in your browser. Nothing you enter is uploaded or stored.
- Price
- Free for everyone. No subscriptions, no payments, no watermark.
- Works offline
- Yes, once the page has loaded
- Last checked
- by AK Shine
Worked example
A 1200 x 800 sunset illustration (sample-photo.png), 6 colours, most used first
#4B3581 (24.9%), #1A1749 (22.3%), #A46765 (21.1%), #7B4D70 (18.0%), #CC8562 (12.2%), #EEDEB8 (1.6%). As CSS: --colour-1: #4B3581; and so on.
The two purples and the deep navy make up about two thirds of the picture, the warm orange of the sun about an eighth, and the pale cream of the sun's core is a small accent. The same image always gives the same palette.
When to use something else
- A palette shows averages. A tiny but important accent, such as a red button in a large screenshot, may merge into a nearby colour: raise the number of colours or crop the image to that area first with Crop Image.
- Photos with gradients give in-between colours that are not exactly any single pixel. To get the exact colour of one point use the Image Colour Picker.
- To build matching shades and tints from one colour use the Colour Palette Generator, and to check text contrast use the Contrast Checker.
Questions people ask
How does it choose the colours?
It splits all the pixels into groups with the median cut method, then moves each group towards its true centre with k-means until the groups stop changing. Each colour you see is the average of its group, and the percentage is how many pixels belong to it.
Why are the colours slightly different from the pixels in my image?
Each palette colour is an average of many similar pixels, so it may not match any one pixel exactly. If you need the exact colour of a single point, such as a logo's brand colour, use the Image Colour Picker.
How many colours should I pick?
For a brand or website palette, 5 or 6 is usually enough: one or two main colours, one or two accents and a light and dark neutral. Choose 8 to 12 for detailed photos or illustrations.
How do I get a palette from a logo on a white background?
Turn on Ignore white background. Pixels that are almost pure white are then left out, so the palette shows only the logo's colours. Use Ignore black background for images on black.
Can I use the colours in Canva, Figma or CSS?
Yes. Tap a colour to copy its HEX code and paste it into Canva, Figma or any design app. For websites, copy the CSS variables or SCSS block, and for apps or design tokens use the JSON.
Is my image uploaded?
No. The picture is opened and analysed in your browser and nothing is sent to our server, so you can use client artwork or private photos.