Extract a color palette from an image
Pull the dominant colors out of an image as hex swatches.
To get a color palette from image files, upload a JPG, PNG, WEBP, GIF or BMP up to 20 MiB, choose how many colors you want (2 to 12) and download the result. You receive a PNG strip of swatches, each labelled with its hex code such as #1a2b3c. Colors are picked by median-cut quantization, so the palette reflects the dominant tones of the whole picture rather than a single pixel you clicked.
How to extract colors from a picture
Choose an image, set the number of colors (the default is 6, the range is 2 to 12) and pick an order. Submit the form and download color-palette.png. Each swatch is a 120 pixel square with its hex code written underneath, so you can read the values off the image and type them into a design tool or stylesheet.
Most used first or rainbow order
Most used first puts the colors that cover the most of the picture on the left, which is useful when you want the main brand or background color. Rainbow order sorts the same colors by hue instead, which gives a tidy gradient-like strip for mood boards. The colors themselves are identical in both modes; only the sequence changes.
What to expect from the result
The palette is an approximation. Median-cut groups similar shades and returns one representative per group, so a small accent such as a red button may be merged into a neighbouring color when you ask for few colors. Raise the count to keep more accents. The tool does not pick a color at an exact point, and it outputs an image, not a copyable text list.
Good source images
Photos, logos, screenshots and artwork all work. For a clean brand palette, use a flat logo and a low count. For a photo, use 6 to 10 colors. If the image is huge, run it through the Image Resizer first; if you want to reuse the colors on a website, pair this with the Favicon Generator.
Frequently asked questions
How do I get hex codes from an image?
Upload the image to the color palette extractor and download the PNG it returns. Every swatch has its hex code printed underneath, for example #e4572e, which you can type into any design tool or CSS file.
How many colors can I extract?
You can extract between 2 and 12 colors per image, with 6 as the default. A low number gives the dominant tones only. A higher number keeps smaller accents that would otherwise be merged into similar shades.
Does it find the dominant color of an image?
Yes, in the sense that the default order lists the most used colors first, so the leftmost swatch is the dominant tone. Extract two or three colors if you only need the main one or two.
Which image formats and sizes are supported?
You can upload JPG, JPEG, PNG, WEBP, GIF and BMP files up to 20 MiB. HEIC photos from an iPhone must be converted first with the HEIC Converter before you can extract colors from them.
Can I pick a color at an exact spot in the image?
No. The tool analyses the whole image and returns a set of representative colors, not the value at a clicked pixel. To isolate part of a picture, crop it first and then extract its palette.
Related tools
Background Remover
Automatically remove the background from any photo.
Use tool →Background Changer
Swap in a new background color or image instantly.
Use tool →Image Converter
Convert between JPG, PNG, WEBP, GIF and more.
Use tool →Image Compressor
Reduce image file size with minimal quality loss.
Use tool →Image Resizer
Resize photos to any dimension or aspect ratio.
Use tool →Image to PDF
Bundle one or more images into a single PDF.
Use tool →