Extract colours from an image
Upload an image and get its dominant colour palette, with the HEX code and the weight of each colour.
Drag your image here or click to choose it
Supports JPG, PNG and WebP
How the dominant palette is computed
The image is painted on a canvas and its pixels are read. To keep the analysis fast even on huge photos, a regular sample of pixels is taken instead of walking through all of them, and transparent ones are skipped.
percentage = box pixels ÷ analysed pixels × 100
Pixels are grouped into a 5-bit-per-channel 3D histogram, and a median-cut algorithm runs over those groups: the colour box holding the most pixels is repeatedly split along its widest channel until there are as many boxes as colours you asked for.
The final colour of each box is the true average of the pixels inside it, and its percentage says how much of the image it represents. Sorted by weight, the first ones are the colours that visually define the photo.
Worked example
On a beach photo at sunset, a 6-colour palette typically returns a warm orange at around 30%, two blues from the sea and sky, a sand tone and two dark shades from the silhouettes.
Frequently asked questions
- Why aren't the colours exactly those in the photo?
- Each palette colour is the average of a group of similar shades. If you need the exact value of one spot, use the image colour picker.
- What is a dominant palette good for?
- Designing around an image: choosing a card background, a button colour over a hero photo, or generating a theme that matches your brand.
- How many colours should I extract?
- Five to eight is the usual range. Fewer loses nuance, many more starts returning nearly identical shades.
- Are transparent areas taken into account?
- No. Nearly transparent pixels are discarded so a cut-out PNG does not return the colour of empty background.
Related calculators
- Compress JPGShrink a JPG photo by choosing how much compression to apply.
- Compress PNGShrink a PNG by reducing how many colours its palette holds.
- Compress WebPShrink a WebP image by choosing its compression quality.
- JPG to WebPConvert JPG photos to WebP so your site loads faster.
- PNG to WebPConvert PNG images to WebP while keeping transparency.
- WebP to JPGConvert WebP images to JPG so any program can open them.
- Resize imageChange the pixel width and height of an image without distorting it.
- Change image resolution (DPI)Set the DPI of an image and control its real printed size.
- Crop imageDrag a selection over the image and crop it to that rectangle.
- Convert imageConvert between JPG, PNG and WebP by picking the output format.
- Favicon generatorBuild every favicon size and the .ico file from one image.
- Image to Base64Turn an image into a Base64 string or a ready-to-paste data URI.
- Image colour pickerClick anywhere on an image and read that pixel in HEX, RGB and HSL.
- OG image generatorCreate a 1200 × 630 px Open Graph image with your title and colours.