HandyTools Hub

Image Color Extractor

Extract the dominant colors from any image

Drag & drop an image here

or click to browse

Supports JPEG, PNG, WebP, GIF

Extraction Settings

How to Use

  1. Upload your image — Drag and drop a JPEG, PNG, WebP, or GIF file onto the upload area, or click to browse your device. Everything is processed locally in your browser—nothing is uploaded to any server.
  2. Choose the number of colors — Select 5, 6, or 8 dominant colors. The palette updates instantly every time you change the count.
  3. Copy individual colors — Click any swatch to copy its hex value to your clipboard. Each swatch also shows the exact RGB values.
  4. Export the whole palette — Use “Copy All Hex Values” for a plain list, or copy the ready-made CSS custom properties (--color-1 through --color-8) and paste them straight into your stylesheet.

Features

  • Deterministic median-cut quantization — The same image always produces the same palette, so your results are reproducible and easy to share with teammates.
  • Smart downscaling — Images are reduced to a maximum edge of 100 pixels before analysis, keeping extraction instant even for 4K photos without affecting the dominant colors.
  • Hex + RGB for every swatch — Each color shows both formats at a glance, sorted from darkest to lightest by perceived luminance.
  • One-click copying — Click any swatch to copy its hex value, or grab the entire palette in one action.
  • CSS variables export — Generate a :root block of CSS custom properties ready to paste into any project.
  • 100% client-side privacy — All analysis runs in your browser via the Canvas API. Your images never leave your device.

Use Cases

  • Web and UI design — Pull a matching color scheme from a brand photo, hero image, or mockup to use for buttons, backgrounds, and accents.
  • Design systems — Extract palette candidates from marketing imagery and drop them into your CSS as custom properties in seconds.
  • Art and illustration reference — Study how photographers and painters combine tones by breaking an image down to its dominant colors.
  • Social media and presentations — Match text and graphic colors to the photos in your slides or posts for a cohesive look.
  • Image Compressor — Reduce image file size while maintaining quality, directly in your browser.
  • Image Cropper — Crop, rotate, and flip images in-browser before extracting their palette.
  • Color Palette Generator — Generate harmonious color schemes from a single seed color using color theory.
  • Color Picker — Pick and convert colors between HEX, RGB, and HSL formats.

Frequently Asked Questions

How does the color extraction work?

The tool downscales your image to a maximum edge of 100 pixels, then applies median-cut quantization — a deterministic algorithm that repeatedly splits the color space at its widest channel and averages each resulting group. This reliably surfaces the colors that actually dominate the image, unlike random-initialization methods such as k-means.

Are my images uploaded to a server?

No. All processing happens entirely in your browser using the Canvas API. Your images never leave your device, which makes the tool both private and fast — it even works offline after the page loads.

Why can I only choose 5, 6, or 8 colors?

A palette of 5–8 colors covers the dominant tones of virtually any photo or screenshot without overwhelming you with near-duplicate shades. If the image contains fewer unique colors than requested, the tool simply returns fewer swatches.