Extract a color palette from any image
Extract the dominant color palette from any photo or design and export the swatches as SVG, CSS variables, or JSON. Great for moodboards and brand systems.
Down-samples your image and runs a median-cut quantizer to find the most representative colors. Click any swatch to copy the hex code or export the full palette in your favourite format.
Extracting and using color palettes from images
Color palette extraction analyzes an image to identify its most prominent colors — the hues that define its visual character. This is done through quantization algorithms that group similar pixels together and find representative colors for each cluster. The result is a small set of swatches (typically 5-10 colors) that capture the image's chromatic essence.
Designers use extracted palettes to build color systems that harmonize with photography. If your website hero image features warm oranges and deep blues, extracting those exact hex values ensures your buttons, headings, and accents complement the imagery rather than clashing with it. This creates visual cohesion across the entire design.
The median-cut algorithm used here is deterministic — the same image always produces the same palette. It works by recursively splitting the color space along the axis with the greatest range until the desired number of colors is reached. Colors are then sorted by visual weight (how many pixels they represent) so the most dominant color appears first.
Export options include SVG strips for design tools, CSS custom properties for web development, and JSON for programmatic use in design systems or build tools. The hex codes are ready to paste into Figma, Sketch, CSS files, or any tool that accepts hex color values.
Common use cases
- Brand color development: Extract colors from inspiration images, mood boards, or competitor designs to develop a brand palette grounded in visual research rather than arbitrary selection.
- Web design color matching: Pull exact hex values from hero images or product photos to use as accent colors in buttons, links, and UI elements that harmonize with the visual content.
- Interior design and fashion: Analyze photos of rooms, outfits, or nature scenes to identify complementary color combinations for physical design projects.
- Data visualization theming: Generate chart and graph color schemes from brand imagery, ensuring data visualizations feel visually connected to the rest of your design system.
Technical details
- Algorithm
- Median-cut quantization. The image is downsampled, then the color space is recursively partitioned along the axis with the greatest range until the target color count is reached.
- Deterministic output
- The same image with the same color count always produces identical results. No randomness is involved in the quantization process.
- Color sorting
- Extracted colors are sorted by pixel weight (dominance). The first swatch represents the most prevalent color in the image, and subsequent swatches represent decreasing prevalence.
- Export formats
- SVG (visual strip), CSS custom properties (--color-1 through --color-n), and JSON (array of hex strings). All formats use standard 6-digit hex notation.
How to extract a palette from an image
Generate a dominant color palette and export it for design or code.
- Drop one image into the palette tool.
- Set how many colors you want.
- Click any swatch to copy its hex code.
- Export the palette as SVG, CSS variables, or JSON.
Frequently asked questions
Which colors does the tool pick?
It samples the image, ignores transparent pixels, and then partitions the colors via median-cut. The largest buckets become your dominant swatches, sorted by weight.
Will the same image always produce the same palette?
Yes. The quantizer is deterministic for a given image and color count, so two runs on the same source give identical hex values.