Color Palette Extractor — Extract Colors from Any Image
Upload any image and instantly extract its dominant colors as a palette. Export as CSS custom properties, SCSS variables, JSON, Tailwind config, Adobe Swatch (ASE) or PNG swatch strip.
Drop an image here or click to browse
JPG, PNG, WebP, GIF — any format
How it works
- 1Drop an image onto the upload area or click to browse — any format (JPG, PNG, WebP, GIF).
- 2The dominant color is shown as a large swatch with HEX, RGB and HSL values.
- 3The full 10-color palette is displayed as clickable swatches.
- 4Click any swatch to see its precise color values and copy them.
- 5Export the palette as CSS custom properties, SCSS variables, JSON, Tailwind config, ASE, or PNG.
- 6Click "Generate Gradient" to open the gradient generator pre-loaded with your palette colors.
Frequently asked questions
What Is Color Theory in Design?
Color theory is the body of practical guidance explaining how colors mix, match, and communicate meaning. It draws on both physics (how light and pigment behave) and psychology (how the human brain perceives and responds to color). For designers, color theory translates into concrete decisions: which colors to combine, which to contrast, and which to use for emotional effect.
The foundation is the color wheel — a circular model showing relationships between primary colors (red, yellow, blue in traditional pigment theory; red, green, blue in light), secondary colors formed by mixing primaries, and tertiary colors formed by mixing primary with adjacent secondary. Relationships on this wheel — complementary, analogous, triadic — define color harmonies that feel visually coherent.
In digital design, color theory informs every choice from brand identity to accessibility. High-contrast complementary pairs create urgency and draw attention — used for call-to-action buttons, alerts, and highlights. Analogous palettes create calm and unity — used for backgrounds, illustrations, and ambient elements. Triadic schemes balance variety and cohesion — used for brand palettes that need to feel energetic without being chaotic.
Extracting colors from an existing image — as this tool does — is one of the most effective ways to build a palette grounded in real-world color relationships. Nature, architecture, and photography capture color harmonies that have already proven visually compelling. Use our Color Picker to explore any individual color from your extracted palette in detail.
How Dominant Color Extraction Works (Median Cut Algorithm)
This tool uses the ColorThief library, which implements the median cut algorithm for color quantization. Here is how it works:
Step 1 — Sample pixels. The image is drawn to a hidden canvas. The library reads the RGB values of every pixel (or a statistically significant sample for large images).
Step 2 — Build the color space. All sampled pixels are treated as points in a three-dimensional RGB color space. Similar colors cluster together.
Step 3 — Median cut. The algorithm finds the dimension (R, G, or B) with the widest range of values. It cuts that range at the median — splitting the color space into two halves with equal numbers of pixels. This repeats recursively until the desired number of buckets (color swatches) is reached.
Step 4 — Representative colors. Each bucket is averaged to produce one representative color. The most frequently occurring bucket becomes the dominant color; the others form the palette.
The result is a palette that represents the most visually significant colors in the image, not just the most mathematically frequent ones. Edge pixels and near-duplicate colors are smoothed out through the averaging step. This makes median cut superior to simple frequency counting for photographic images with gradual color gradients.
Using Brand Colors from Images
One of the most practical uses of palette extraction is establishing a digital brand palette from a physical or existing visual asset — a logo, product photograph, or brand photography.
From a logo. Upload your company logo (ideally a PNG with transparent background) to extract its precise brand colors as HEX and RGB values. Use these values to ensure consistency across your website, app, and print materials — avoiding "drifted" colors that occur when designers eyeball matches.
From photography. Brand photography — lifestyle shots, product photos, team photos — contains a natural color story. Extracting the palette from your hero image and using those colors for UI elements creates visual coherence between your imagery and your interface.
From a competitor's design. Screenshot a competitor's website or brand material and extract their color palette to understand their visual positioning — useful for deliberately differentiating your brand.
Once you have the extracted colors, export them as CSS custom properties and paste them directly into your design system. Use the "Generate Gradient" button to immediately open our CSS Gradient Generator pre-loaded with your palette colors.
CSS Variables vs SCSS Variables
Both CSS custom properties and SCSS variables let you define colors once and reuse them throughout your codebase, but they work at different layers and have different capabilities.
CSS custom properties (CSS variables) are native to the browser. They are declared with --name: value; and used with var(--name). Because they exist at runtime, they can be changed dynamically — updated via JavaScript, overridden in media queries, or swapped for dark/light themes without rebuilding CSS. They cascade like any CSS property.
:root {
--color-1: #6366F1;
--color-2: #8B5CF6;
}
.button {
background: var(--color-1);
}
@media (prefers-color-scheme: dark) {
:root {
--color-1: #818CF8; /* lighter shade for dark mode */
}
}SCSS variables are preprocessor constructs — they are resolved at compile time and do not exist in the browser. Declared with $name: value;, they are replaced with their literal values in the compiled CSS. They cannot be changed at runtime, but they work seamlessly in SCSS functions and mixins, making them useful for generating consistent color scales and utility classes.
The modern recommendation is to use CSS custom properties for anything that might need to change at runtime (theming, dark mode, user preferences) and SCSS variables for compile-time constants like spacing scales and type sizes. For color palettes, CSS custom properties are generally the better choice.
Adobe Swatch Exchange (.ase) Format Explained
Adobe Swatch Exchange is a binary file format for transferring color palettes between Adobe applications — Photoshop, Illustrator, InDesign, and others. It is the standard for sharing named color libraries across a design team using Adobe tools.
An ASE file contains a header (4-byte magic ASEF, version, block count) followed by a sequence of color block records. Each block contains the color name (UTF-16), color model (RGB , CMYK, LAB , GRAY), float values for each channel, and a color type flag (global, spot, or process).
Our tool generates an ASE file with RGB color entries using the hex codes as names. To use the exported file in Adobe Photoshop: open the Swatches panel, click the menu icon, choose "Load Swatches", and select the .ase file. In Illustrator: Window → Swatches → Swatch Libraries → Other Library → select the .ase file.
For non-Adobe tools: Affinity Designer and Photo both support ASE import. Figma does not natively import ASE, but you can use the hex values from the JSON or CSS export formats and add them manually to Figma styles or a plugin like Color Variables.
Frequently Asked Questions
How many colors will be extracted from my image?
The tool extracts 1 dominant color and a palette of up to 10 additional colors, for a total of up to 11 swatches. The dominant color is the single most visually prominent color. The palette represents the 10 most visually significant color clusters. All processing happens in your browser — no image data is sent anywhere.
What image formats are supported?
Any format your browser can display: JPEG, PNG, WebP, GIF, AVIF, BMP, SVG, and more. HEIC may work in Safari. For best results, use the original image rather than a screenshot or export — compression artifacts can introduce false colors.
Why does the palette not match the colors I expected?
The median cut algorithm finds the most statistically significant color clusters. Very small areas of bright color (like a thin highlight or a small logo) may be outweighed by large areas of neutral background. Try cropping the image to focus on the area you care about before uploading.
How do I use the Tailwind config export?
Copy the Tailwind output and paste it into your tailwind.config.js under theme.extend.colors. This adds your palette colors as custom utilities: bg-brand-1, text-brand-2, border-brand-3, etc. Then use these classes throughout your markup.
What is the ASE file used for?
ASE (Adobe Swatch Exchange) is the standard format for sharing color palettes between Adobe applications — Photoshop, Illustrator, and InDesign. Download the ASE file and import it via the Swatches panel in any Adobe app.
How do I open the palette in the gradient generator?
Click "Generate Gradient". This opens the CSS Gradient Generator in a new tab pre-loaded with your top 5 extracted colors as gradient stops. You can then adjust positions, add stops, and copy the CSS output.
Is my image uploaded to your servers?
No. The image is read entirely in your browser using the Canvas API and the ColorThief library. No pixel data is ever sent to any server. The tool works offline once the page is loaded.
Keep going
Related Tools
Color Picker & Converter
Pick colors and convert between HEX, RGB, HSL, CMYK and more instantly
CSS Gradient Generator
Create beautiful CSS gradients with live preview and one-click copy
Color Contrast Checker
Check WCAG color contrast ratios for accessible web design
Image to SVG Converter
Convert PNG and JPG images to scalable SVG vectors automatically
Image Compressor
Compress JPG, PNG, and WebP images without losing quality.
Image Format Converter
Convert images between JPG, PNG, WebP, AVIF, and HEIC formats.
Image Editor
Full-featured Photoshop-like image editor — layers, filters, brushes — free in your browser
PDF Text Extractor
Extract all text from a PDF as plain text, with page structure preserved