Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

Color Palette from Image

Get the main colors of any photo or logo, with how much of the image each one covers.

Design No upload Works offline Free, no sign-up

Next steps

About the Color Palette from Image

Drop, paste or choose an image and get its dominant colors — from 3 to 16 — sorted by how much of the picture each one covers. Numbered points on the image show where each color comes from; drag a point to a different spot and its swatch follows. It works for photos and for logos and flat graphics, whose exact colors are kept.

The image is analysed on your device. A small copy of about 48,000 pixels is clustered with k-means in the OKLab color space, so colors that look alike are grouped the way you see them, and the same image always gives the same palette. Export the result as CSS variables, Tailwind, SCSS, JSON, Adobe swatches (.ase), a PNG or SVG palette card, or a CSS gradient whose stripes follow each color’s share.

How to use it

  1. Drop an image on the box, select the box to choose a file, or paste an image with Ctrl+V (⌘V on a Mac).
  2. Choose how many colors to extract, and sort them by Most common, Hue or Lightness.
  3. To fine-tune a color, drag its numbered point on the image — or focus the point and use the arrow keys. Reset points returns to the automatic result.
  4. Copy a code from the list, or export the whole palette below. Open in Palette Generator lets you lock, edit and extend it.

Examples

Stripes that match each color’s share
Input
Palette #1d3557 (70%), #f1faee (30%) · Code format: CSS stripes
Result
background: linear-gradient(90deg, #1d3557 0% 70%, #f1faee 70% 100%);

Useful as a quick visual summary of a photo, or as a placeholder background while the photo loads.

A flat logo
Input
A PNG logo in navy and orange on white, 6 colors requested

Large flat areas are snapped to their exact pixel values, so navy, orange and white come out exactly. The thin anti-aliased edges between them make up only a fraction of a percent, and are hidden while Hide colors under 0.5% is on.

A landscape photo
Input
A sunset photo, 5 colors

Expect a few large groups (sky, land, water) at the top of the list and smaller accent colors below. Each swatch is the average of its group, which may not match any single pixel; drag its point onto a spot you like to use a real pixel color instead.

Common uses

  • Pulling brand colors out of a logo file to build a style guide or website theme.
  • Turning a mood-board photo into a palette for a design, illustration or interior.
  • Matching slide, poster or social-media colors to a hero photo.
  • Getting a CSS gradient placeholder that resembles an image while it loads.

How the colors are found

  • The image is copied at a smaller size (about 48,000 pixels) by picking pixels rather than blending them, so no in-between colors are invented. Transparent pixels are skipped unless you turn that off.
  • Each pixel is converted to OKLab, a perceptual color space in which equal distances look like equal differences.
  • The colors are grouped with k-means: Lloyd’s algorithm (1982), started with the k-means++ seeding of Arthur and Vassilvitskii (2007). A fixed random seed makes the result reproducible.
  • Each swatch is the average color of its group. If one exact color makes up at least half of a group — a flat area of a logo — that exact color is used instead.
  • Groups whose colors are closer than the just-noticeable difference that CSS Color 4 uses (0.02 in OKLab) are merged, and the image is clustered again to look for other colors, so no two swatches look the same. If the image has fewer clearly different colors than you ask for, you get fewer swatches and the page says so.
  • The share is the fraction of analysed pixels closest to that color.

Photos, logos and screenshots

For logos and flat graphics, request at least as many colors as the logo has; images with no more distinct colors than you ask for return their exact colors. PNG, SVG and WebP lossless files work best, because JPEG compression adds noise that spreads each flat color over many nearby values.

For photos, 5 to 8 colors usually summarize the image well. Large areas such as sky or skin take the first places; use Sort by hue or lightness to arrange the swatches for a palette, and drag points onto details you want to include.

Sample points

Every number on the image marks a typical pixel of that color, chosen inside a uniform area rather than on an edge. When you drag a point, the swatch takes the average of the 3 × 3 pixels under it on the displayed image, and all shares are recalculated for the new palette. Points that you moved are marked picked in the list.

Limitations

  • Colors come from a reduced copy of about 48,000 pixels, so details only a few pixels wide in a large image may not get a color of their own.
  • Swatches are averages of their group and may not appear exactly anywhere in a photo; drag the point to use a real pixel color.
  • Browsers convert wide-gamut (Display P3) and CMYK images to sRGB before the page can read them, and only the first frame of an animated image is analysed.
  • HEIC/HEIF photos from iPhones open directly in Safari. Other browsers first download the libheif decoder (1.4 MB, LGPL-3.0) from this site, once; it then decodes the photo on your device.

Privacy

Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot.

Frequently asked questions

How many colors should I extract?

For a photo, 5–8 is a good start; more colors split large areas into similar shades. For a logo, choose at least as many colors as it contains. Shades that look the same are merged, so a two-color logo saved as JPEG still gives two main colors, and small, faint extras from anti-aliased edges are hidden while Hide colors under 0.5% is on.

Why is a swatch slightly different from the pixels I see?

In photos, each swatch is the average of many similar pixels, so it summarizes an area rather than copying one pixel. Drag the numbered point onto the exact spot you want, and the swatch takes that spot’s color (a 3 × 3 pixel average).

Can I get the exact colors of a logo?

Yes. Flat areas are snapped to their exact pixel values, and an image with no more distinct colors than you request returns its exact colors. Use the original PNG or SVG rather than a JPEG or a screenshot, which can shift colors slightly.

What does the percentage next to each color mean?

It is the share of the analysed pixels that are closest to that color. Shares add up to 100% of the visible (non-transparent) pixels, including any small colors that are hidden from the list.

Is my image uploaded?

No. The image is opened and analysed by your browser, and the page works offline once loaded. Nothing about the image is sent to a server.

Quick answers and tool search

Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.