Browser only - 100% private

Color Palette Extractor

Extract the dominant colors from any image - get hex, RGB, and HSL codes for 5, 10, or 16 colors. Copy as CSS variables or download a swatch PNG.

  • Live preview
  • Privacy-first
  • No signup

Upload an image to extract its color palette.

Median-cut quantization runs entirely in your browser. Drag on the preview to pick colors from a specific area.

Color Palette online with ImgShifter

The Color Palette Extractor reads an image, downsamples it to a 160 px thumbnail for speed, and runs median-cut color quantization to find the dominant colors. Median-cut is the same algorithm used by GIF encoders and most palette generators - it recursively splits the RGB color space along its longest axis until the requested number of colors is reached, then averages each box to a single representative shade. The whole pass takes well under a second on typical photos.

Every color is shown in three formats - HEX (#FF7E3D), RGB (rgb(255, 126, 61)), and HSL (hsl(18, 100%, 62%)) - so you can paste straight into whichever tool you're using next. Click any value to copy it. For design systems, use Copy as CSS variables to get a paste-ready :root block with --color-1 through --color-N. For sharing in design docs, use Download swatch PNG to export a strip with hex codes and percentage shares rendered onto each color.

Pick 5 colors for tight brand palettes, 10 for richer themes, or 16 for retro pixel-art-style lookups. Everything runs in your browser - the image is decoded on-device with the Canvas API and quantized in pure JavaScript. No upload, no signup, no watermark. The percentages reflect each color's share of the quantized output, which is approximate but reliable for ranking.

Keep going

Other ImgShifter tools people use alongside Color Palette.

Frequently asked questions

Short answers for image workflows, privacy, and supported formats.

How does the color palette extractor work?

ImgShifter downsamples your image to a small thumbnail (160 px on the long edge), reads every pixel into a list, and runs median-cut color quantization - the same algorithm used by GIF encoders and most palette generators. The image space is recursively split along its longest color axis until the requested number of colors is reached, then each box is averaged to a single representative color. The whole pass takes under a second on most images.

How many colors can I extract?

5 colors for a typical brand or social palette, 10 colors for richer themes or design systems, 16 colors for retro-style pixel-art lookups and palette-constrained outputs. Pick the size that matches the design context. The default is 5 because most brand work uses a tight primary palette.

What formats are the color codes in?

Each color is shown as HEX (#FF7E3D, the standard for web and design tools), RGB (rgb(255, 126, 61), preferred for CSS calculations), and HSL (hsl(18, 100%, 62%), the easiest format for adjusting lightness or saturation by hand). Click any of the three to copy that format to the clipboard.

Can I export the palette?

Three ways. Copy as CSS custom properties (--color-1: #ff7e3d; ... in a :root block) for instant use in stylesheets. Download a PNG swatch strip with the hex code and percentage share rendered on each color, suitable for sharing in design docs. Or copy individual hex/RGB/HSL values one at a time for ad-hoc use.

Why are the percentages slightly off from what I'd expect?

The percentages are the share of pixels in each color box after quantization, not the share of perfectly matching pixels in the original. Median-cut groups similar shades together, so a 'red' bucket might also include burgundy and salmon tones. For a brand color analysis the relative ranking is what matters; the exact number is approximate.

Is my image uploaded anywhere?

No. The extractor runs entirely in your browser - the image is decoded with the Canvas API on your device, sampled, and quantized in JavaScript. No upload, no signup. Verify in the Network tab while you extract, or disconnect from the internet after the page loads.

Can I extract the palette from an iPhone HEIC photo?

Yes. Drop a .heic or .heif file straight from your iPhone, iPad, or Mac. ImgShifter decodes it locally with a WebAssembly module before sampling, so the median-cut quantization runs on the same pixels you'd see if you exported the photo as JPG first. The HEIC decode never reaches a server.