Logo

MonoCalc

/

Image Color Palette Extractor

Media

Drag an image here or paste one from the clipboard. JPEG, PNG, WebP, GIF, AVIF and BMP, up to 25 MB and 50 megapixels.

Everything runs in your browser and the image is never uploaded. There is no web-address field: an image from another site would stop the browser from reading its pixels.

Transparent

About This Tool

Image Color Palette Extractor – Turn Any Picture into a Usable Palette

A photo, a logo or a screenshot already contains a colour scheme. This image color palette extractor finds it: drop in an image and it returns the handful of colours that make it up, how much of the picture each one covers, and where each one sits. You can then copy the HEX codes, CSS variables, SCSS or Tailwind tokens, or download an Adobe .ase swatch file, a GIMP .gpl palette or a PNG palette card. Everything happens on a canvas in your browser, and the image never leaves your device.

How palette extraction works

The image is first sampled at up to 512 pixels on its longest edge with smoothing turned off, so every sample is a real pixel rather than a blend of two neighbours. Transparent pixels are skipped. If a few exact colours cover 98% of what is left, as they do in logos, icons and flat illustrations, those exact colours become the palette, so a brand mark comes back with its true hex values. Otherwise the colours are grouped with weighted k-means clustering, seeded deterministically, so the same image always gives the same palette.

An average of a group is often a colour that never appears in the image, for example the muddy blend along the edge of a shape. So each swatch is the group’s weighted medoid: the real image colour that sits closest to everything else in its group. Swatches closer than one just-noticeable difference are merged.

Why a perceptual colour space beats RGB

Distances in RGB do not match what people see. Two blues 40 RGB units apart can look almost identical, while two greens the same distance apart look clearly different. Clustering in RGB therefore wastes swatches on shades you cannot tell apart. This tool clusters in OKLab, a perceptually uniform space designed by Björn Ottosson in 2020 and now the basis of CSS oklch(). In OKLab, a distance of about 0.02 is one just-noticeable difference, which is the threshold the tool uses to merge colours and to report how faithful the palette is.

Reading the average error
Under 0.02 means the palette is virtually identical to the image; 0.02–0.05 is close; 0.05–0.10 is simplified; above that, more colours would help.

Dominant colours versus vibrant colours

An area-based palette shows the colours that dominate a picture, which is what you want for backgrounds and large surfaces. It can miss a small striking accent, such as a red jacket in a green landscape. The vibrant and muted picks fill that gap. Adapted from the default targets of Android’s Palette API, they score candidate colours by saturation, lightness and population to find a Vibrant, Light Vibrant, Dark Vibrant and three muted roles. The palette map view repaints the image with only the current swatches, so you can see what a six-colour version of the picture looks like, and hovering a swatch highlights where it lives. For anything still missing, the eyedropper reads exact full-resolution pixels and pins them to the palette.

Building a UI theme from a photo

Colours that look good together are not always readable together. The WCAG contrast grid pairs every palette colour, plus white and black, as text on background. Normal body text needs at least 4.5:1 (AA), large text and interface components need 3:1, and 7:1 earns AAA. Use the passing pairs for text and buttons, and keep the rest for decoration and illustration.

Which format does each app import?

  • Illustrator, Photoshop, InDesign, Affinity: the Adobe Swatch Exchange .ase file, imported as one colour group.
  • GIMP, Inkscape, Krita: the .gpl palette.
  • Web projects: CSS custom properties, SCSS variables, a Tailwind v4 @theme block or a Tailwind v3 config.
  • Figma and everything else: the HEX list or the JSON file, which also carries RGB, HSL, OKLCH and coverage.
:root { --sky-blue: #87CEEB; --gray: #8D6E63; }

Want to convert a swatch to CMYK or LAB? Open it in the Color Space Converter. Need harmonies built from one colour? The Random Color Generator creates complementary and analogous schemes.

Colour profiles
Values are sRGB as your browser decodes the image. Wide-gamut photos, such as Display P3 images from recent phones, are converted to sRGB first, so the most saturated colours can differ slightly from what a colour-managed editor shows.

Frequently Asked Questions

Is the Image Color Palette Extractor free?

Yes, Image Color Palette Extractor is totally free :)

Can I use the Image Color Palette Extractor offline?

Yes, you can install the webapp as PWA.

Is it safe to use Image Color Palette Extractor?

Yes, any data related to Image Color Palette Extractor only stored in your browser (if storage required). You can simply clear browser cache to clear all the stored data. We do not store any data on server.

Is my image uploaded anywhere?

No. The image is decoded and read on a canvas inside your browser, so the tool keeps working with the network disconnected. That is also why there is no field for an image URL: drawing a picture from another website taints the canvas, and the browser then refuses to hand back its pixels.

How does this tool choose the colours?

If a handful of exact colours cover 98% of the image (a logo or flat illustration), those exact colours are the palette. Otherwise it groups the pixels with weighted k-means in the perceptual OKLab colour space and picks, for each group, the real image colour that best represents it (the weighted medoid). There is no randomness, so the same image and settings always give the same palette.

Why is a small bright colour missing from my palette?

The palette is chosen by area, and colours covering less than the "Hide colours under" threshold (0.5% by default) are hidden. Lower that threshold, check the Vibrant picks row, which looks for striking accents regardless of area, or click the colour in the image with the eyedropper to pin it.

Why does Photoshop show a slightly different hex value?

Browsers convert images with an embedded colour profile, such as Display P3 from an iPhone, to sRGB before the tool reads them, and very saturated colours are clipped in the process. JPEG compression noise and privacy features in some browsers, which add tiny random changes to canvas reads, can also shift a value by a level or two.

How do I get the palette into Illustrator, Photoshop, GIMP, Figma or Tailwind?

Download the .ase file for Illustrator, Photoshop, InDesign and Affinity, or the .gpl file for GIMP, Inkscape and Krita. For code, copy the CSS variables, SCSS, Tailwind v3 or Tailwind v4 tab. In Figma, paste the hex values from the HEX tab into fill colours or a styles plugin.

What do AA and AAA mean in the contrast grid?

They are WCAG 2 contrast levels. AA needs a ratio of at least 4.5:1 for normal text, AAA needs 7:1, and AA Large (3:1) is enough for large or bold text and for interface components such as icons and input borders.