Color Palette Extractor
Pull the dominant colors from any image. Median-cut quantization, browser-side, copy hex codes.
Drop an image here or click to browse
PNG, JPG, WebP, AVIF — up to 30 MB
Extract dominant colors from any image using median-cut quantization. Hex + RGB output, CSS array export, browser-side.
Color Palette Extractor pulls the dominant colors out of an image so you can recreate a brand palette, find the colors of a stock photo before designing around it, or generate a Tailwind palette from a moodboard. Designers do this manually with the Photoshop eyedropper — this tool does it in 2 seconds for any image.
Pickrack's Color Palette Extractor uses the median-cut algorithm — the same quantization technique that GIF encoding and most palette extractors use. It samples the image at moderate resolution (240px max edge), recursively splits the color space along the channel with the largest range, and averages each bucket. Output: 3 to 12 dominant colors with hex codes, RGB values, and a CSS-array copy button.
Free, no signup, no upload. The image stays in your browser memory. All processing is JavaScript + Canvas, no server roundtrip.
Key features
- Median-cut quantization — Industry-standard color reduction algorithm. Splits color space at the largest-range channel recursively until you have K buckets, then averages.
- 3-12 swatches, adjustable — Drag the slider to choose how many colors to extract. 5-6 is typical for branding; 10-12 for full moodboard analysis.
- Hex + RGB output — Each swatch shows hex (#FF5733) for CSS/design tools and rgb(255, 87, 51) for canvas/JavaScript code.
- CSS array export — One-click copy of all colors as a JSON-style array: ["#FF5733", "#33C7FF", …]. Paste into Tailwind config or CSS variables.
- Browser-side, no upload — Image and computation stay in your browser. Privacy guaranteed for unreleased product designs or client assets.
How to use
- Step 1: Upload an image — Drop or click. PNG, JPG, WebP, AVIF up to 30 MB. The image is resized internally to 240px max edge for fast sampling (output palette is identical regardless of source size).
- Step 2: Adjust color count — Default 6 swatches. Slider goes 3-12. More colors = finer palette but diminishing returns past 8-10.
- Step 3: Copy individual hex codes — Click the copy icon next to any swatch. Hex code goes to clipboard.
- Step 4: Or export the full palette — Click 'Copy' next to the CSS array at the bottom. Paste into your Tailwind config or design tool.
When to use
- Brand palette extraction — drop a competitor's logo, get their primary colors
- Tailwind color scale generation — drop a brand image, get 5-6 starting colors for
colors: { brand: { ... } } - Stock photo prep — extract the dominant 5 colors of a hero image, design surrounding UI to match
- Moodboard analysis — extract 12 colors from a Pinterest-style moodboard, find the actual color story
- Print preparation — get the dominant colors of an image to feed to a Pantone matching tool for spot-color prints
- Data viz inspiration — pull a 6-color palette from a beautiful photo, use as a data-viz categorical color scheme
Frequently asked questions
Why median-cut vs. k-means?
Median-cut is fast (O(n log k)) and deterministic — same image always produces same palette. K-means is slightly higher quality but slower (multiple iterations) and non-deterministic (different runs can give different palettes). For palette extraction the speed/determinism tradeoff favors median-cut, which is also why GIF, PNG-8, and most palette tools use it.
Why does the tool resize to 240px before sampling?
Sampling all 1080p = 2 million pixels takes 3-5 seconds and the result is identical to sampling 240px = ~50k pixels. Median-cut on 50k pixels is instant and produces statistically identical buckets. The visible output palette is the same regardless of source size.
Why are my palette colors sorted by frequency, not by hue?
By default, larger buckets (more pixels) come first — these are the *dominant* colors that visually define the image. If you want them sorted by hue or by lightness instead, that's on the roadmap. Workaround: copy the array and sort it in your IDE.
Can I extract colors from a specific region instead of the whole image?
Not in v1 — the whole image is sampled. For region-specific palettes, crop the image first with Pickrack's Image Cropper, then run this tool on the crop.
Why doesn't the palette include pure white or pure black?
Because pure white/black are typically background or shadow, not 'dominant brand colors'. Median-cut averages within each bucket, so a bucket of mostly-white pixels with a few off-whites averages to a near-white shade like #F8F8F8, not exact #FFFFFF. This is usually what you want for branding.
Are JPG vs PNG inputs treated differently?
No. Both are decoded to RGB and sampled identically. JPG compression artifacts may introduce slight color noise that affects the bucket boundaries — for highest-fidelity palettes use PNG sources.
Can I download the palette as an image?
Not in v1. For now, copy the hex codes and use a tool like Coolors.co or Adobe Color to render a palette swatch image. PNG palette export is on the roadmap.
Related tools
Image Cropper
Crop images with preset aspect ratios (1:1, 4:3, 16:9, 9:16) or freeform. Browser-side, no upload, instant export to PNG or JPG.
Image Resizer
Resize JPG, PNG, WebP images to any dimensions. Browser-side, no upload, no quality loss for downscaling.
Image Compressor
Compress JPG, PNG, WebP images with adjustable quality. Browser-side, no upload, real-time preview.