Skip to main content
OS Authority

Extract a color palette from an image

Choose a photo or graphic, select a palette size and extract its representative colors. Copy the complete HEX and RGB list or download it as JSON for your next design.

Your image is decoded and sampled in a worker in your current browser tab. Its contents and palette values are not uploaded or included in analytics. The tool does not save them between visits.

How it works

  1. Choose one still JPEG, PNG, WebP or HEIC image from your device.
  2. Choose up to 3, 5 or 8 colors and select Extract palette.
  3. Review the image preview and color swatches. Copy the full palette or download its HEX and RGB values as JSON.

How representative colors are selected

The image is reduced to a thumbnail with a longest side of at most 256 pixels. Sampled RGB values are grouped into 4,096 color boxes, nearby groups are merged and the most common groups are returned. The colors are averages, so a swatch may not exactly match any single source pixel. Downsampling can also blend small details. This is a compact design palette, not a complete inventory of every color.

Transparent images and small palettes

Sampled pixels with an alpha value below 128 out of 255 are ignored. Remaining pixels count equally, without compositing onto a white or black background. A transparent image with no qualifying pixels returns no colors. A two-color logo may produce only two swatches even when you request eight; similar shades are merged rather than added to fill the list.

HEX and RGB palette exports

Each color has a six-digit HEX code and an RGB value with channels from 0 to 255. For example, pure red is #FF0000 and rgb(255, 0, 0). Copy includes every displayed color; the JSON download contains one object per swatch with hex and rgb fields. Color-profile conversion, display settings and thumbnail sampling can affect the result. Use Color Picker from Image when you need a particular pixel instead.

Supported images and device limits

Use one still JPEG, PNG, WebP or HEIC image. GIF, SVG and animated images are not supported. Files and decoded dimensions are checked before processing; limits are lower on phones and low-memory devices. If an image is too large, resize it first. Extraction runs only when you select Extract palette, and Cancel stops the worker.

Frequently asked questions

Does this find every color in my image?

No. It samples a small thumbnail and groups similar shades to produce up to 3, 5 or 8 representative colors. Tiny details and rare colors may be absent.

Why are there fewer colors than I requested?

The requested size is a maximum. Images with few distinct groups return fewer swatches because similar shades are merged. Pixels with alpha below 128 are excluded.

Can I copy colors into CSS or a design app?

Yes. Each swatch includes HEX and RGB values. Copy the complete list, then paste the values you need into your editor. Download JSON if you want a structured palette file.

How is this different from the color picker?

This page creates and exports a complete palette with an adjustable maximum size. Color Picker from Image lets you select a specific point and read its color.

Last reviewed: November 7, 2026

Related tools