Image Color Palette — Extract dominant colors from images

Extract dominant colors from images. Runs in your browser.

Updated May 15, 2026
Share & Support

What's included

Features

Dominant color extraction using median-cut quantization — groups similar pixels into the most visually significant color clusters
6–12 colors with an adjustable count slider to control palette size based on how many distinct shades you need
HEX, RGB, and HSL output for each extracted color — switch format per swatch or copy all at once
One-click copy for any color in any format directly to the clipboard
Drag-and-drop upload supporting JPG, PNG, WebP, and GIF image formats
Canvas API processing — the image is drawn locally in your browser and never uploaded to any server
Image preview displayed alongside the extracted palette for visual comparison
Private by design — works with watermarked, proprietary, or confidential images without any upload
Pairs with [Color Picker](/color-picker/) for precise color manipulation and [Color Palette Generator](/color-palette-generator/) for harmony schemes

About this tool

Extract the Dominant Color Palette From Any Image

Matching brand colors from a logo, building a color scheme from a product photo, or checking what colors a competitor uses in their design — all start with extracting the colors that actually appear in an image. This color palette extractor analyzes any image and identifies the dominant colors, grouped by visual prominence, entirely on your device.

Drop or upload an image and the tool samples pixels across it, clusters similar colors together, and returns as many dominant colors as you choose — drag the slider anywhere from 4 up to 150, with 12 as the default starting point. Each color is shown as a swatch with its HEX, RGB, and HSL values, and a format toggle lets you switch every swatch between the three at once. Click any color to copy its current format to the clipboard.

How color extraction works. Before sampling, the image is scaled down so its longest edge is at most 300px and drawn onto a hidden canvas via the Canvas 2D drawImage API, keeping extraction fast even for large photos. Rather than reading every pixel, the tool strides through the canvas's pixel buffer so roughly 5,000 samples are taken regardless of image size, skipping pixels whose alpha channel is below 128 so transparent PNG backgrounds aren't counted. Those RGB triplets feed a median-cut quantization algorithm: it finds which channel (red, green, or blue) has the widest range across the current pixel bucket, sorts along that channel, and splits the bucket in half — recursively, to a depth of log2(your chosen count) — before averaging each final bucket into one representative color. The result favors visually significant color groups over a list of every unique pixel value, which is why a photo with thousands of shades still produces a clean set of swatches.

Runs fully in your browser. Because the image only ever touches a canvas element in your own browser tab, nothing is uploaded anywhere — you can safely extract colors from private, proprietary, or watermarked images.

Using extracted colors in your project. Copy the HEX values into CSS custom properties, Tailwind config files, or brand guideline docs. For building out a full harmony scale from a single extracted swatch, pair this with the Color Palette Generator; for fine-grained hue, saturation, or lightness tweaks, use the Color Picker.

Step by step

How to Use

  1. 1
    Upload or drop an imageClick the upload area or drag and drop any image file — JPG, PNG, WebP, GIF, or SVG. The extraction runs immediately after the image loads.
  2. 2
    Wait for palette extractionThe tool samples the image and groups pixels by color similarity. This typically takes under a second for most images.
  3. 3
    Copy colors you needClick any color swatch to copy its HEX code. Use the dropdown on each swatch to switch between HEX, RGB, and HSL format.
  4. 4
    Adjust the number of colorsUse the color count slider to extract fewer (6) or more (12) dominant colors depending on how many distinct shades you need.
  5. 5
    Use colors in your projectPaste the HEX codes into your CSS, design tool, or brand guidelines. Use with Color Picker to explore variations.

Real-world uses

Common Use Cases

Extract brand colors from a logo
Upload a logo PNG and get the exact HEX, RGB, and HSL codes for the brand colors to use in CSS variables, design tokens, or style guides.
Build a color scheme from a product photo
Extract the dominant palette from a product image to create a matching color scheme for a landing page, campaign, or packaging design.
Match colors from reference images
Upload a design reference image and extract its palette to match colors accurately in your own work without manual eyedropper hunting.
Analyze competitor design color choices
Extract palettes from competitor screenshots or marketing materials to understand their design language and inform your own color decisions.
Generate palettes from photography
Extract color inspiration from landscape, architectural, or portrait photography for creative projects, mood boards, or brand identity work.
Find exact hex codes from mockups
Upload a design mockup or screenshot and extract precise hex codes for colors you need to reproduce in CSS or a design tool.

Got questions?

Frequently Asked Questions

The image is drawn to an HTML Canvas element, pixels are sampled, and similar colors are grouped using a median-cut quantization algorithm. The most visually prominent color groups are returned as the palette.

No. The image is processed entirely in your browser using the Canvas API. It is never sent to any server.

JPG, PNG, WebP, and GIF are supported. SVG files may be supported depending on your browser.

The extractor groups similar colors together and returns the dominant groups. A photo may contain thousands of unique pixel colors — the palette shows the most visually significant distinct colors, not every shade.

Yes. Use the color count slider to extract between 6 and 12 dominant colors.

Click any color swatch to copy its HEX code, then paste it directly into your CSS color property. Switch to RGB or HSL format if your project uses those.