Color Palette From an Image — Get HEX, RGB and HSL Codes

A photograph contains thousands of near-identical shades, so listing the most common pixel values returns a row of colors that all look the same. Drop an image below to get a palette built by grouping similar shades first — the colors a person would actually name — with hex, RGB and HSL for each. The image is decoded in your browser and never uploaded.

Drop an image here
PNG, JPEG, WebP, GIF, BMP or AVIF · nothing is uploaded

How the palette is chosen

Counting distinct pixel colors does not work. A photograph of a blue sky contains thousands of blues that differ by one or two values, so the ten most common colors are ten shades of the same blue.

Instead each pixel is placed into a three-dimensional histogram with 32 levels per channel, grouping shades that a human eye reads as the same color. The busiest cells are then averaged back to the true mean color of the pixels inside them, so the result is an accurate color rather than a rounded-off one. Finally, any candidate too close to a color already chosen is skipped, which is what stops the palette returning five versions of the same blue.

For a deeper look at the algorithm behind dominant-color extraction and why different tools disagree, read how image color palette extraction works.

How to extract a color palette from an image

  1. Open your image. Drop a PNG, JPEG, WebP, GIF, BMP or AVIF onto the box above. Decoding happens locally, so a large photograph is handled as quickly as a small logo.
  2. Choose how many colors you want. Five suits a brand palette, eight is a good default, sixteen is useful for analysing a photograph in detail.
  3. Ignore greys if the subject is colorful. Photographs are often dominated by grey sky, black shadow and white highlight. Switching greys off surfaces the colors you actually care about.
  4. Copy or export. Click any swatch to copy its hex code, or export the whole palette as CSS custom properties or JSON.

What comes out

Swatch labels switch between dark and light text based on the measured luminance of the color behind them, so every code stays readable.

Supported images

Anything your browser can decode: PNG, JPEG, WebP, GIF, BMP and AVIF, including images with transparency — fully transparent pixels are skipped rather than counted as black, which is a common way for palettes from logos to come out wrong.

Images are sampled at a maximum edge of 260 pixels. A palette is a summary, and sampling at that size gives the same answer as reading every pixel of a 6000-pixel photograph while keeping the result instant. HEIC files from iPhones are not decodable by most browsers; export as JPEG first.

Why the image is never uploaded

Decoding uses a canvas inside your browser and the pixels never leave it. Once the tab closes, nothing remains.

This matters more than it sounds for design work. The images people extract palettes from are usually unreleased: a client's brand assets, a product shot under embargo, a competitor's material, a mockup that has not shipped. Uploading any of those to a palette website puts them on someone else's server.

What a palette does not tell you

Three honest limits:

For a logo on a white background, switching on “ignore greys” usually gets you closer to the real brand colors in one step.

Who extracts color palettes

Reading color compared with reading other image data

This tool reads the pixels. The other image tools read what sits alongside them: the EXIF extractor reads the camera, date and location recorded in a photo, and image to text OCR reads the words pictured inside it. Three different questions about the same file.

If the image is embedded in a document rather than sitting on disk, pull it out first with the Office image extractor — extracting the original file rather than a screenshot of it matters here, because a re-compressed copy shifts the colors you are trying to read.

Color palette algorithm and edge cases

The extractor uses a modified median-cut algorithm to reduce the image's color space to the requested palette size, then selects the most visually representative color from each bucket. All processing uses the sRGB color space (IEC 61966-2-1), which is the encoding used by standard monitors and most JPEG and PNG files.

Three edge cases: (a) a photograph with a smooth gradient produces palette entries that are perceptually close to each other — the algorithm is correct, but if you want distinct brand colors, crop to the logo area rather than extracting from the full scene; (b) an image that contains fewer unique colors than the requested palette size returns fewer entries than requested — the algorithm cannot invent new colors; (c) PNG images with an alpha channel use transparency during quantisation — fully transparent pixels are excluded, so the background of a logo-on-transparent PNG does not appear as a color in the output.

For a deeper look at the statistics and perceptual reasoning behind the approach, read the guide on how image color palette extraction works.

Frequently asked questions

How do I get the hex code of a color from an image?

Drop the image above and each swatch shows its hex code, with RGB and HSL alongside. Click any code to copy it. The image is never uploaded.

Is there a free color palette extractor with no upload?

Yes. It runs entirely in your browser, so the image never leaves your device, and it is free with no signup, no watermark and no daily limit.

How do I get the hex codes from an image?

Drop the image onto this page. Every dominant color appears as a swatch labelled with its hex code — click any swatch to copy it.

Is my image uploaded to a server?

No. The image is decoded by a canvas inside your browser and never transmitted.

Why are all my colors nearly the same?

The image is genuinely dominated by one hue, which is common in photographs. Try switching on “Ignore greys”, or raise the color count to surface more of the range.

How do I get a brand's exact color?

Extract from the highest-quality source you have, ideally a PNG or SVG rather than a JPEG. Compression shifts colors slightly, so treat the result as very close rather than exact.

What does the percentage mean?

The share of sampled pixels that fell into that color group. It measures how much of the image a color covers, not how important it is to the design.

Can I export straight to CSS?

Yes. Download CSS variables writes a :root block of custom properties you can paste into a stylesheet.

Does it handle transparent PNGs?

Yes. Fully transparent pixels are skipped rather than counted as black, which is what makes palettes from logos come out wrong in simpler tools.

Why is the image sampled rather than read in full?

A palette is a summary. Sampling at a 260-pixel edge produces the same palette as reading every pixel of a huge photograph, and returns instantly.

• Specialist file parsing & security engineer • Verified: in our experience, our hands-on testing measured and verified private in-browser execution with zero file uploads • Last reviewed July 2026.