Image Color Palette Generator - Extract Colors from a Photo

Tools /
/ Image Converters / Image Color Palette

Color palette from an image

6
—

Click anywhere on the image to read the exact color of that pixel.

Dominant colors

Click a code to copy it

The image is analysed in your browser and never sent anywhere. Transparent pixels are ignored.

How to get a color palette from an image

A photo can contain tens of thousands of slightly different colors. A palette groups them into a handful of representative colors and tells you how much of the picture each one covers — useful for building a website theme from a hero photo, matching a brand color from a logo or picking colors for a presentation.

How to use it

  1. 1 Choose an image or drop it on the box. The palette of the sample sunset is replaced immediately.
  2. 2 Set the number of colors (3 to 12) and the method. If a small accent color is missing, raise the number.
  3. 3 Click any HEX, RGB or HSL code to copy it, click the image for an exact pixel, or copy the whole palette as CSS variables or JSON.

k-means or median cut?

k-means starts from a few well-spread pixels and repeatedly moves each color to the average of the pixels closest to it, so the result usually matches what your eye picks out. Median cut repeatedly splits the most varied group of colors along its widest channel, cutting where the two parts come out most uniform; it is predictable and fast but tends to split large smooth gradients (a sky) into several similar shades. k-means uses a fixed seed and median cut involves no randomness at all, so the same image always gives the same palette. With either method, shades too close to tell apart are merged into one color.

Why a color you can see may be missing

The palette is weighted by area. A red button that fills 1% of a screenshot has to compete with the 60% white background, so with 5 colors it gets merged into its nearest neighbour. Raise the color count, crop the image to the part you care about, or click the button in the image to read its exact pixel. Also remember that palette colors are averages: a cluster of many similar greens may produce a green that no single pixel has.

Logos, transparency and JPEG noise

Pixels that are more than half transparent are not counted, so a PNG logo on a transparent background gives only the logo’s own colors. JPEG is different: it has no transparency and its compression adds faint in-between shades around sharp edges. If a flat brand color comes out as #1A73E9 instead of #1A73E8, that is compression, not the tool — click a solid area with the picker, and for official work use the value from the brand guidelines.

Using the palette in CSS

The CSS export gives custom properties (--palette-1, --palette-2 …) in order of share, ready to paste into :root. HSL is the handiest format for variations: keep hue and saturation and change only the lightness for hover or background tints. Before using a palette color for text, check its contrast against the background — normal-size text needs at least 4.5:1 to meet WCAG AA, and colors taken from photos are often too mid-toned to pass.

Other Tools You May Like Color Converter

Image color palette: frequently asked questions

No. The file is read by your browser, drawn on a canvas and analysed on your device. Nothing is sent, so private screenshots and unreleased designs are safe to use.
New
Rotate & Flip Image Rotate an image 90°, 180° or by any angle, flip it horizontally or vertically and download PNG, JPEG or WebP. Runs in your browser, nothing is uploaded.
Popular Today
PDF to PNG Turn every page of a PDF into a lossless PNG: text and lines stay razor sharp, pick the resolution and download pages singly or as a ZIP.

Related Image Converters

Image Converter Free image converter: pick PNG, JPG, WebP, GIF or BMP and convert any picture in your browser - your photos are never uploaded to a server.
WebP to PNG Convert WebP to PNG for free: transparency is preserved and the image never leaves your device - the whole conversion runs in your browser.
PNG to JPG Convert PNG to JPG for free: pick the quality and a background colour for transparent areas, all in your browser with no upload.
WebP to JPG Convert WebP to JPG for free: choose the quality and the background colour for transparent areas - everything runs in your browser.
JPG to WebP Convert JPG to WebP for free: cut image weight for faster pages while choosing the quality yourself, all inside your own browser.

Other Tools You May Like

Word to PDF Convert Word to PDF for free: upload a DOC, DOCX, ODT or RTF file and download a properly formatted PDF in seconds - no registration or watermark.
PDF to Word Convert PDF to Word for free: upload a PDF and download an editable DOCX in seconds - no registration, no watermark and nothing to install.
Currency Converter Convert 165 currencies with official central bank rates. Both amount fields are editable, and each pair shows the publication date of its rate.
CSV to JSON Turn CSV into JSON in your browser. Handles quoted fields, embedded commas and line breaks, detects the delimiter, and never uploads your file.
Unit Converter Convert length, weight, temperature, volume, area, speed, data size and time. Exact definitions, no rounded factors, and every unit in the group at once.