Image Tools
Color Palette Extractor
Extract dominant colors and generate palettes from any image. Free online tool — no upload, no sign-up, runs entirely in your browser.
See how to use this toolColor Palette Extractor
Extract dominant colors and copy palette values.
About Color Palette Extractor
ToolConv's color-palette extractor reads any image and returns its dominant colors using a k-means clustering pass over downsampled pixels, then exports them as hex, RGB, HSL, and a ready-to-paste CSS custom-property block. Designers use it to build a brand palette from a hero photograph; developers use it to seed Tailwind or CSS variable themes without guessing. Because the image is processed entirely in-browser via Canvas getImageData, you can run it on confidential product shots or client mood boards without anything leaving your machine.
Beyond the top-N palette, the tool reports the average color, the most saturated color, and a WCAG contrast ratio against white and black for each swatch — so you can immediately tell whether a brand red will pass AA as body text. You can lock individual colors to re-cluster the rest, and copy any swatch with one click.
How to use it
- 1Upload the image you want to extract colors from.
- 2Set how many colors you want (default 6; range 3–12).
- 3Optionally lock a swatch and re-cluster to refine the palette around it.
- 4Check each swatch's WCAG contrast against white/black for accessibility.
- 5Copy a single hex, or export the whole palette as CSS variables.
When to use it
- ✓Deriving a 5-color brand palette from a hero photograph for a new landing page.
- ✓Generating a Tailwind config from a client's existing logo PNG.
- ✓Checking whether a button color meets WCAG AA contrast against the page background.
- ✓Building a mood-board color reference for a design system documentation page.
Features
- •k-means clustering with adjustable cluster count (3–12 colors).
- •Outputs hex, RGB, HSL, and a copy-ready CSS custom-property block.
- •WCAG contrast ratio displayed for each swatch against white and black.
- •Lock-and-recluster so you can refine a palette around a must-keep color.
Related tools
Image Compressor
Re-encode one JPG, PNG, or WebP image. Choose the output format and maximum width, then check the preview and file size.
Image Resizer
Set the pixel width and height of a JPG, PNG, or WebP image. Preserve its aspect ratio or export at exact dimensions.
Image Cropper
Crop images online with aspect ratio presets. Free online tool — no upload, no sign-up, runs entirely in your browser.
SVG Editor
Edit and optimize SVG files online. Free online tool — no upload, no sign-up, runs entirely in your browser.
Favicon Generator
Generate favicons and app icons from any image. Free online tool — no upload, no sign-up, runs entirely in your browser.
Image Watermark
Add text or image watermarks to protect your photos. Free online tool — no upload, no sign-up, runs entirely in your browser.
Screenshot Beautifier
Add beautiful backgrounds and device frames to screenshots. Free online tool — no upload, no sign-up, runs entirely in your browser.
Audio Extractor
Extract and isolate audio tracks from video or audio files. Free online tool — no upload, no sign-up, runs entirely in your browser.
FAQ
Are my images uploaded to extract the palette?
No. The image is read into a Canvas and sampled with getImageData, all locally. You can extract palettes from unreleased product photos without any data leaving your device.
Which algorithm is used to pick the colors?
k-means clustering on a downsampled pixel set (typically 10k–50k pixels) in RGB space, with a fixed random seed so the same image always yields the same palette.
Can I export colors directly into my CSS?
Yes. The 'Export CSS' button copies a :root block with --color-1 through --color-N custom properties, ready to paste into your stylesheet.
Why does a brightly colored photo give me muddy colors?
k-means minimizes overall distance, so large neutral areas (sky, walls) can dominate. Reduce the cluster count, or lock a vivid swatch and re-cluster so the algorithm has to fit around it.
Does the tool handle transparency in PNGs?
Yes. Fully transparent pixels are excluded from clustering, so a logo with a transparent background yields colors from the actual artwork, not from the alpha channel.
Is the WCAG contrast calculation accurate?
Yes, it uses the standard relative-luminance formula from WCAG 2.1. Note it measures text-on-background contrast; for large UI fills you should also consider the surrounding context.