Color Palette from Image

Pick out the main colours of any photo and copy them as HEX codes, CSS variables or a swatch PNG.

Loading the tool…

How to use the Color Palette from Image

  1. Tap Select Image and choose a JPG, PNG, WebP or GIF.
  2. Set how many colours you want to extract.
  3. Click any swatch to copy its HEX code.
  4. Use Copy HEX Codes, Copy CSS Variables or Download Swatch PNG.

About this tool

Get the colour palette from any image. Upload a photo, logo, screenshot or artwork and OmneKit finds its dominant colours, sorted from the largest area to the smallest. Click a swatch to copy its HEX code, copy the whole set as CSS variables, or download a swatch strip as a PNG.

Designers use it to match a client's brand colours, build a website theme from a photo, or pick paint and fabric shades. You choose how many colours to extract, and transparent pixels are ignored. The image is analysed in your browser and never uploaded.

Why OmneKit

  • Private: your image is analysed on your device, never uploaded.
  • Free, instant and without sign-up.
  • Colours sorted by how much of the image they cover.

Frequently asked questions

What algorithm is used to extract the palette?

OmneKit uses k-means++ clustering on the image pixels. The image is first downsampled to at most 160×160px for speed, then k-means runs for up to 15 iterations to find stable cluster centroids. k-means++ initialization spreads the starting centroids across the color space, which avoids poor local minima and produces more representative colors compared to random initialization.

How many colors should I extract?

For most photos, 6–8 colors captures the dominant palette without too much repetition. Simple graphics, illustrations, or flat-design images work well with 4–6 colors. Complex scenes with rich gradients (sunsets, forest canopies) may benefit from 10–12 to capture the full range. If nearby swatches look near-identical, reduce the count.

Why does the palette sometimes include near-identical shades?

OmneKit merges shades that look the same, and the blended pixels along edges, into the color they belong to. So a simple graphic shows only its real colors, and you may get fewer swatches than you asked for. If two swatches still look close, they differ enough to tell apart side by side; lower the count to merge them.

Are the colors sorted in any particular order?

Yes — colors are sorted by dominance (highest pixel-count cluster first). The leftmost swatch is the color that covers the largest area of the image. This makes it easy to identify the primary, secondary, and accent tones of any photo at a glance.

What does clicking a swatch do?

Clicking any swatch copies its HEX code to your clipboard. The swatch label briefly changes to "Copied!" to confirm. You can also copy all HEX codes at once, copy them as CSS custom property declarations (--color-1: #...; etc.), or download the full palette as a PNG swatch strip.

Can I extract colors from a PNG with transparency?

Yes. Transparent pixels (alpha < 128) are automatically skipped during sampling. Only fully or mostly opaque pixels contribute to the palette. This means logos and icons with transparent backgrounds produce accurate palettes based solely on their visible colors.

Is my image uploaded anywhere?

No. The entire process runs in your browser. The image is drawn to an off-screen canvas for pixel sampling, and all k-means computation happens in JavaScript on your device. No image data is ever sent to a server.

  • Files stay on your device
  • Free, no sign-up
  • No upload wait
  • Works on phone & desktop