Palette generator, free, no upload
Color palette from image
To get a color palette from an image, open the image here. Its 5 to 8 main colors appear at once, each with its HEX code and the share of the picture it covers. Copy one color, the whole list or a block of CSS variables, or save the palette as a PNG strip. The image is read on your device and is never uploaded.
- 5 to 8 main colors with HEX codes
- Copy as a list or CSS, or save a PNG
- Image never leaves your device
Drag over the image to get the average color of that area.
This browser changes the pixel values it hands to web pages, a protection against tracking, so the codes here can be slightly off. For exact values, allow this page to read canvas data, or open the page in another browser.
Picked color
Click or tap a pixel of the image. Its color and codes appear here.
Values are 8-bit sRGB. CMYK is a plain conversion with no print profile, so treat it as an approximation.
Picked colors
Kept only while this page is open.
Contrast of your last two colors
Color palette from this image
The main colors by median cut, from up to about 40,000 pixels of the image. Tap a color to copy its HEX code. The same image always gives the same palette.
How to make a color palette from an image
Open an image
Drop it on the box, choose a file, or paste a screenshot with Ctrl + V. JPG, PNG, WebP, AVIF, GIF, BMP, SVG and HEIC files open, and nothing is uploaded.
Choose how many colors
The palette starts with 6 colors. Press 5, 7 or 8 colors for a shorter or longer one.
Copy what you need
Tap a color to copy its HEX code. Copy HEX list takes them all, and Copy CSS variables gives a block ready for a style sheet.
Save the palette
Save PNG strip makes a picture of the palette with the codes written on it. Save text file lists HEX, RGB and HSL for each color.
What a color palette from an image is for
A palette pulled from a picture is a quick way to make other things match it. Designers take one from a photo to color a website, a slide deck or a poster around it. Others use it to match paint, fabric or decoration to a room photo, to build a brand palette from a logo, to keep illustrations in one color family, or to give a chart the colors of the report it sits in.
The palette generator here answers one question: which few colors make up most of this image, and how much of it does each cover. For the exact color of one pixel, pick it in the image under the palette, which is the color picker from image on the same page. To change a color of the picture itself, use change image color.
How the palette generator chooses the colors
We sample up to about 40,000 real pixels of the image on a fixed grid, place them in a color cube, and split the fullest group at its middle again and again until there is one group for each color you asked for. That method is called median cut. Each palette color is the average of its group, and the percentage under it is the share of the sampled pixels in that group.
Nothing in it is random, so the same image always gives the same palette in the same order. Flat graphics such as logos, charts and screenshots give their exact colors. A photo gives averages, so a palette color can sit between the pixels it stands for: a sky that runs from pale to deep blue becomes one or two blues. Pixels that are mostly see-through are left out, and an image with fewer distinct colors than you asked for gives a shorter palette, with a note.
Every code is 8-bit sRGB, the color space of web pages. An image with a wider color profile, such as a recent phone photo, is converted to sRGB by the browser first, and the page names the profile when it finds one.
Use the palette in CSS, design apps and documents
CSS. Copy CSS variables gives a block of custom properties, one for each color, that you can paste into a style sheet and use by name.
Design and office apps. Paste a HEX code into the color field of your design, slide or document app. The PNG strip can be dropped onto a canvas or a mood board and sampled with that app's own eyedropper. It carries the codes as text on each block and no logo or watermark.
Notes and hand-offs. The text file lists every color as HEX, RGB and HSL with the CSS variables under them, so someone else can use the palette without opening the image.
The page shows the size of the PNG strip and the text file before you save them.
Questions
How do I get a color palette from an image?
Open the image in the tool above. Its main colors appear right under the box, each with its HEX code and the share of the image it covers. Choose 5 to 8 colors, then copy them or save the palette as a PNG strip or a text file.
Is this color palette generator free, and is my image uploaded?
It is free, with no sign-up, no watermark and no daily limit, and your image is not uploaded. Your browser reads the pixels on your device. A line under the result counts the requests the page has sent since you added the image, so you can check that for yourself.
How many colors does the palette have?
Between 5 and 8: it starts with 6, and the buttons above the palette switch to 5, 7 or 8. An image with fewer distinct colors, such as a two-color logo, gives a shorter palette, and the page says so.
Why is a palette color not exactly a color I see in the photo?
In a photo each palette color is the average of a group of similar pixels, so it can sit between them. For the exact color of one spot, click that spot in the image under the palette: the color picker shows the HEX, RGB and HSL codes of that single pixel.
Can I get the HEX codes of the palette?
Yes. Each color shows its HEX code, and a tap copies it. Copy HEX list puts all the codes on your clipboard, one to a line, and the text file adds the RGB and HSL values of each color.
How do I use the palette in CSS?
Press Copy CSS variables. You get a block of custom properties, one for each color, to paste into your style sheet. The text file holds the same block under the color codes.
Does the same image always give the same palette?
Yes. Nothing in the method is random: the image is sampled on a fixed grid and split the same way every time, so the palette and its order never change for the same file.