Colour Palette From Image
Pull the dominant colours out of a picture as HEX, RGB and HSL, with CSS variables.
Processing: This tool runs entirely in your browser. Your input and any file you open stay on your device — nothing is uploaded to a server.
How to use the colour palette from image
- Open an image.
- Adjust how many colours you want.
- Copy individual values or the whole set as CSS variables.
About this tool
Colours are grouped using median-cut quantisation: the tool repeatedly splits the set of pixels along whichever colour channel varies most, then averages each group. It is the classic approach for this, and it produces colours that genuinely represent the image rather than a handful of extremes.
The image is sampled down before analysis, so a 20-megapixel photo is as fast as a thumbnail without changing which colours dominate. Each swatch shows its share of the picture, so you can tell a background colour from an accent.
Contrast against white and black is shown for each colour, because a palette pulled from a photograph often looks lovely and fails as text.
Common uses
- Building a theme around a hero photograph.
- Matching a design to a brand image.
- Finding the dominant colour for a placeholder background.
Frequently asked questions
- Why are the colours slightly different from the picture?
- Each swatch is the average of a group of similar pixels, so it represents a region rather than one exact pixel. Ask for more colours to get finer distinctions.
- Are transparent areas included?
- No. Pixels that are mostly transparent are skipped, so a logo on transparency gives the logo's colours rather than a wash of grey.
Related tools
HEX to RGB Converter
Convert colours between HEX, RGB and HSL with a live preview and copyable CSS values.
Colour Contrast Checker
Check text and background colours against the WCAG 2.1 contrast requirements for AA and AAA.
CSS Gradient Generator
Build linear and radial CSS gradients visually and copy the generated background property.
EXIF & Image Metadata Viewer
See the camera, exposure, date and location data hidden inside a photo.