Skip to main content
L
Loopaloo
Buy Us a Coffee
All ToolsImage ProcessingAudio ProcessingVideo ProcessingDocument & TextPDF ToolsCSV & Data AnalysisConverters & EncodersWeb ToolsMath & ScienceGames
Guides & BlogAboutContact
Buy Us a Coffee
L
Loopaloo

Free online tools for developers, designers, and content creators. Your files are processed in your browser and are never uploaded - no accounts required. A few network utilities (like What's My IP and Currency Converter) call public APIs to do their job and say so on their pages.

support@loopaloo.com

Tool Categories

  • Image Tools
  • Audio Tools
  • Video Tools
  • Document & Text
  • PDF Tools
  • CSV & Data
  • Converters
  • Web Tools
  • Math & Science
  • Games

Company

  • About Us
  • Contact
  • Blog
  • FAQ

Legal

  • Privacy Policy
  • Terms of Service
  • Disclaimer

Support

Buy Us a Coffee

© 2026 Loopaloo. All rights reserved. Built with privacy in mind.

Privacy|Terms|Disclaimer
  1. Home
  2. Image Processing
  3. Image Color Palette Extractor
Add to favorites

Image Color Palette Extractor

Extract the main colours of a photo as a palette with hex, RGB and HSL codes and their share of the picture, and export it as CSS, SCSS, Tailwind, JSON, CSV or GIMP.

Edits stay in your browserMore image processingJump to full guide

Initializing in your browser…

You might also like

Image Color Grader

Grade the colour of a photo like a film: white balance in kelvin, shadows, midtones and highlights, a tone curve, and split toning, with looks such as teal and orange.

Image to Base64

Turn an image into Base64 text or a data URL to embed in HTML, CSS or Markdown, checked to decode back to your exact file. Optional resizing first.

Image Diff Comparator

Compare two versions of an image and see what changed: each changed area outlined and shown close up, with slider, fade and side-by-side views and a similarity score.

Image Color Palette Extractor: a worked example

A designer wants five colours from a sunset photo to build a matching web page theme.

Settings

sample-sunset.jpg, 1600 x 1067
Colours: 5
Grouping: Median cut
What Image Color Palette Extractor produces

Palette

#020516  black          25.02%   contrast 20.27:1 on white
#4D1D95  indigo         24.99%   contrast 10.91:1 on white
#6A3ADB  blueviolet     24.97%   contrast 6.48:1 on white
#6C2AB0  rebeccapurple  12.51%   contrast 8.09:1 on white
#E16944  tomato         12.51%   contrast 3.33:1 on white

Median cut splits the photo's colours into groups of similar size, which is why the shares come out close to quarters and eighths, and then picks the most common real colour in each group. The near-black of the trees and water is the obvious text colour (20.27:1 on white). The orange of the sun is the natural accent, but at 3.33:1 on white it is only suitable for large text or decoration, not body copy, which needs 4.5:1.

About the Color Palette Extractor

Pull the main colours out of a photo, a logo or a screenshot. The tool shows a strip of the palette sized by how much of the picture each colour covers, lists every colour with its hex, RGB and HSL codes, and exports the palette for CSS, SCSS, Tailwind, JSON, CSV or GIMP.

How to use

  1. 1Drop a picture on the page, paste one, or press Try a sample image.
  2. 2Choose how many colours you want.
  3. 3Pick Most common, Median cut or k-means for the grouping.
  4. 4Tap a hex code to copy it, or use Copy hex codes and the export buttons.

Where this helps

  • Web design

    Themes and accent colours that match the imagery on a page.

  • Branding

    Recover exact colours from a logo or packaging.

  • Art and illustration

    Colour studies and palettes from reference photos.

  • Interior and fashion

    Pick matching colours from a mood photo.

Key features

  • Only colours the picture really contains
  • 3, 5, 8, 12 or 16 colours
  • Three grouping methods: most common, median cut and k-means
  • A palette strip sized by each colour's share of the picture
  • Hex, RGB, HSL and the nearest CSS colour name
  • Text contrast on white and black for each colour
  • Exports for CSS, SCSS, Tailwind, JSON, CSV and GIMP
  • Transparent pixels ignored

Tips & best practices

  • Crop to the area you care about first; a large background dominates the palette.
  • Use the contrast ratios to choose text colours: 4.5:1 or more is the usual target for body text.
  • Try 8 or 12 colours for photos and 3 to 5 for logos.
  • For a consistent set, extract from one photo and reuse the export across a project.

Examples

  • A website theme from a hero photo

    Extract five colours from the header photo with Median cut, export CSS custom properties and use the darkest as the text colour and the brightest as an accent.

  • Brand colours from a logo

    Use Most common on a flat logo to get its exact brand colours, with their hex codes and contrast ratios.

  • A palette for digital painting

    Take twelve colours from a reference photo and export a GIMP palette to load into GIMP, Krita or Inkscape.

How the colours are found

Real colours only. The tool counts the colours of the picture as they are, without shrinking it first. Shrinking blends neighbouring pixels into in-between shades that the picture never contained, which is how some palette tools report a purple from a picture of red and blue stripes. Every colour shown here is one that actually appears in your picture. Very large pictures are counted by sampling every few pixels, which can only ever find real colours.

Three ways to group them. There is no single right answer to which colours are a picture's main ones, so three methods are offered. Most common lists the colours that appear most often, exactly as counted, which suits logos and flat graphics. Median cut splits the picture's colours into groups of similar size and takes the most common colour of each, which gives a balanced palette for photos. k-means groups colours by how different they look to the eye and then shows the real colour closest to each group's average; it starts from a random draw, so Try another draw can give a slightly different result. Choose 3, 5, 8, 12 or 16 colours.

What each colour tells you. Each entry shows the hex code (tap it to copy), RGB and HSL values, the nearest CSS colour name, the share of the picture it represents, and its text contrast ratio on white and on black, so you can see straight away whether a colour works for text. The strip above the list is drawn to scale, so a colour that covers a quarter of the picture takes a quarter of the strip.

Exports. Copy hex codes puts the list on the clipboard. CSS custom properties and SCSS variables come with the colour name and share as a comment, the Tailwind file extends your theme with palette-1, palette-2 and so on, JSON and CSV carry every value, and the GIMP palette opens in GIMP, Inkscape and Krita. How the palette was found shows how many pixels were counted and how far apart the closest two colours are. Transparent pixels are left out, and nothing is uploaded.

Frequently asked questions

Why do the three methods give different palettes?

Because there is no single correct answer to which colours matter most. Most common favours the colours that appear most often, Median cut balances the palette across the picture, and k-means groups colours by how they look. Pick the result that suits your use.

Are these exactly the colours in my picture?

Yes. The picture is not resized before counting, so every colour listed is one the picture contains. For k-means, where a group's average is usually not a real colour, the closest real colour is shown.

What does the percentage mean?

The share of the picture's pixels that belong to that colour's group, so the percentages add up to the whole picture.

Why does k-means change when I try another draw?

k-means starts from randomly chosen colours and refines them. Different starting points can settle on slightly different groups, especially in photos with smooth gradients.

Which export should I use for a website?

CSS custom properties for plain CSS, SCSS variables for Sass, or the Tailwind file to add the colours to a Tailwind theme.

Is my picture uploaded?

No. The colours are counted in your browser.

Related tools and how they differ

  • Color Palette Generator: Builds a palette from colour theory, starting from one colour of your choice.
  • Color Blindness Simulator: Checks whether the colours of a palette stay distinguishable for colour-blind viewers.
  • Color Converter: Converts a single colour between HEX, RGB, HSL and other notations.

Private by design

Images are decoded, edited, and exported entirely inside this browser tab. No originals, exports, or metadata are uploaded.