Color Palette Generator from Image
Add a photo, logo or screenshot and get its main colors as HEX, RGB and HSL codes, ready to copy into your design or code.
Colors people actually see
Similar pixels are grouped in OKLab, a color space built to match human vision, so the palette picks out distinct colors instead of near-identical shades. Every swatch is a real color from your image.
Pick any pixel
Click or tap the image to read the color at that point, add it to the palette, or type in a HEX code. In Chrome and Edge you can also pick a color from anywhere on your screen.
Codes and exports ready to paste
Each swatch lists HEX, RGB and HSL, the nearest CSS color name and the more readable text color with its WCAG contrast. Export the palette as CSS or SCSS variables, a Tailwind theme, JSON, a GIMP palette or a PNG.
How to generate a color palette from an image
- 1
Choose, drop or paste an image, or try the sample picture.
- 2
Set how many colors you want and whether to favor the most common or the most vivid colors.
- 3
Click a swatch to copy its HEX code, or click the image to pick an exact color and add it to the palette.
- 4
Export the palette as CSS, SCSS, Tailwind, JSON, a GIMP palette or a PNG of the swatches.
What people use this tool for
- Build a website or brand color scheme from a photo, logo or mood board.
- Match slide, poster or social media colors to a product photo.
- Find the HEX code of a color in a screenshot or design mockup.
- Create GIMP, Inkscape or Krita palettes from artwork and reference images.
Frequently Asked Questions
How do I get a color palette from an image?
Choose, drop or paste an image. The generator shrinks a copy to 320 pixels on its longer side, takes up to 24,000 visible pixels and groups them into the number of colors you ask for, from 2 to 16. The swatches appear with the share of the image each color covers; click one to copy its HEX code.
How are the colors chosen?
Pixels are clustered with k-means in the OKLab color space, where equal distances look like equal differences to the eye. Each swatch is the real image color closest to the center of its group, so it never shows a muddy average that is not in the picture. Groups that look the same are merged, which is why a simple logo can return fewer colors than you asked for.
What does favoring vivid colors change?
By default every pixel counts the same, so large backgrounds and skin tones dominate. Favoring vivid colors gives saturated pixels more weight, so a small red logo or a bright accent in a gray photo can win a place in the palette. Ignore white and black backgrounds goes further and leaves out near-white and near-black pixels entirely.
How do I find the HEX code of one exact color?
Click or tap that spot on the image. The color under the pointer is shown with its HEX and RGB codes, ready to copy or add to the palette. Large images are displayed at up to 1,600 pixels across, so a tiny detail can read as a blend of its neighbors; crop the image first for single-pixel accuracy.
What is the contrast information for?
It tells you whether text on that color will be readable. The ratio follows WCAG 2: 4.5:1 or more passes AA for normal text, 3:1 passes AA for large text and 7:1 passes AAA. Each swatch shows whether white or black text gives the higher ratio, which helps when you turn a photo's colors into a website or slide theme.
Which export formats are there?
A plain HEX list, CSS custom properties, SCSS variables, a Tailwind CSS v4 @theme block, JSON with HEX, RGB, HSL, share and CSS name, a .gpl palette for GIMP, Inkscape and Krita, and a PNG image of the swatches. Rename the variables to suit your project: with the name brand, Tailwind gets --color-brand-1, used as bg-brand-1.
Which images work?
PNG, JPEG, WebP, GIF, AVIF, BMP and SVG files up to 50 MB and 60 megapixels. In transparent images the see-through pixels are ignored, and for an animated GIF the first frame is used. Phone photos saved as HEIC may need converting to JPEG first, for example with the HEIC converter.
Is my image uploaded?
No. The image is read and analyzed in your browser and never leaves your device. Only your palette settings, such as the number of colors and the export format, are remembered in this browser's local storage under zutilium:color-palette-from-image.