To get the HEX color from an image, open it in a color picker, click the exact spot you want and copy the six-digit code it reads from that pixel, such as #2A78D6. For several colors at once, use a palette extractor, which groups similar pixels and lists each main color with its HEX, RGB and HSL code.
Color Palette Generator from Image does both. Click any point to read its color, or pull 2 to 16 main colors from a photo, logo or screenshot, check which text color stays readable on each, and export the set as CSS, Tailwind or a GIMP palette. The image is analyzed in your browser and never uploaded.
How to get a HEX color from an image with Zutilium
- Open Color Palette Generator from Image and press Choose an image, drop a file on the upload area or paste a screenshot with Ctrl+V or ⌘V. PNG, JPEG, WebP, GIF, AVIF, BMP and SVG files up to 50 MB work.
- To read one color, click or tap the spot you want. Its HEX and RGB codes appear under the image: Copy copies the HEX code, and Add to palette keeps it as a swatch with its HSL code and contrast details.
- For the main colors, set Number of colors (6 by default) and, under Favor, keep Most common colors or choose Vivid colors to bring out small, bright accents.
- Tick Ignore white and black backgrounds for a logo or product shot on a plain white or black background.
- Click a swatch to copy its HEX code, or click its RGB or HSL value to copy that. Order sorts the swatches, the × button removes one, and Add a color by HEX adds a code you type.
- Under Export the palette, choose a Format, type a Variable name such as brand, and press Copy code, Download file or Download PNG swatches.
Each swatch lists its Share of the image, the nearest CSS name and Text on it: the more readable of white or black text, with its contrast ratio and WCAG level. Only your settings are saved in the browser; the image never leaves your device.
Color picker from image or palette: which do you need?
A picker reads one pixel; a palette summarizes the whole picture.
| You want | Do this | Tip |
|---|---|---|
| A logo or brand color | Click the middle of a flat area | Stay away from edges |
| One color in a photo | Click it, then Add to palette | Crop close to tiny details |
| The main colors of a photo | Read the palette | Most common colors |
| A small bright accent | Read the palette | Vivid colors |
| An object on white | Read the palette | Ignore white and black backgrounds |
| A color outside the image | Pick from screen in desktop Chrome or Edge | Or paste a screenshot |
How a color palette from an image is chosen
Zutilium draws a copy of the image at most 320 pixels on its longer side, samples up to 24,000 visible pixels and groups similar ones in OKLab, a color space in which numeric distance tracks how different two colors look. Each swatch is a real pixel near the middle of its group, and its share is the fraction of sampled pixels in that group.
Take a 200 × 100 pixel PNG whose left half is #2A78D6 blue, the next 30% of its width #EB6834 orange and the rest white. Ask for 6 colors and you get exactly those three codes at 50.0%, 30.0% and 20.0%, with a note that the image has only 3 clearly different colors: near-identical groups are merged instead of padding the palette.
Tick Ignore white and black backgrounds and the white swatch goes, while the other two become 62.5% and 37.5% (50 ÷ 80 and 30 ÷ 80), because shares count only the pixels that take part. Transparent pixels never do. The option drops only near-neutral extremes, roughly #F2F2F2 and lighter or #050505 and darker, so a cream or charcoal background stays; remove its swatch with × instead.
Now add random variation of up to 5 units per channel, a simple stand-in for photo and JPEG noise. The shares stay the same, but the codes become #2B75D6, #EA6635 and #FEFFFE, because each swatch is an actual pixel from the noisy image. That is why a logo saved as JPEG can return a code a few units off its official color, and converting the JPG to PNG won't undo it.
Vivid colors weights saturated pixels more heavily (pure red counts about eight times as much as gray), so a small red logo in a gray photo is more likely to get its own swatch.
What HEX, RGB and HSL codes mean
All three describe the same sRGB color in different notation (CSS Color Module Level 4).
- HEX writes red, green and blue (each 0 to 255) as two base-16 digits apiece. In #2A78D6, 2A = 2 × 16 + 10 = 42, 78 = 7 × 16 + 8 = 120 and D6 = 13 × 16 + 6 = 214, so the color is rgb(42, 120, 214).
- Short HEX doubles each digit: #2A7 means #22AA77.
- HSL gives hue (an angle around the color wheel), saturation and lightness. The same blue is hsl(213, 68%, 50%); raise the lightness for a tint or lower it for a shade without changing the hue.
Check text contrast before you use a color
Before you set text on a palette color, check the contrast. WCAG 2 measures it as (L1 + 0.05) ÷ (L2 + 0.05), where L1 and L2 are the relative luminance of the lighter and darker color, from 0 for black to 1 for white. Normal text needs 4.5:1 for AA and 7:1 for AAA, while large text (18 point, or 14 point bold, roughly 24 px or 18.5 px) needs 3:1 for AA (W3C: Understanding Contrast (Minimum)). Ratios are never rounded up, so 4.49:1 fails.
The blue #2A78D6 has a relative luminance of 0.1878. White text gives (1 + 0.05) ÷ (0.1878 + 0.05) = 4.42:1, just short of AA, while black gives (0.1878 + 0.05) ÷ (0 + 0.05) = 4.76:1. That is why its Text on it line reads black, 4.76:1 (AA).
| Background | White text | Black text | Text on it |
|---|---|---|---|
| #2A78D6 blue | 4.42:1 | 4.76:1 | black, 4.76:1 (AA) |
| #EB6834 orange | 3.20:1 | 6.56:1 | black, 6.56:1 (AA) |
| #1B2A4E navy | 14.11:1 | 1.49:1 | white, 14.11:1 (AAA) |
| #767676 gray | 4.54:1 | 4.62:1 | black, 4.62:1 (AA) |
That gray is the lightest neutral gray that passes 4.5:1 on white; #777777 reaches only 4.48:1. The tool tests each color against white and black only, so check pairs of palette colors with the same formula: orange #EB6834 text on navy #1B2A4E comes to 4.41:1, enough for large headings, not body text. Text that is part of a logo has no contrast requirement; text you set in the brand's colors does.
Export the palette to CSS, Tailwind or GIMP
With Variable name set to brand, CSS variables gives this, used as var(--brand-1):
:root {
--brand-1: #2a78d6;
--brand-2: #eb6834;
--brand-3: #ffffff;
}
Tailwind CSS (v4 @theme) gives this:
@theme {
--color-brand-1: #2a78d6;
--color-brand-2: #eb6834;
--color-brand-3: #ffffff;
}
Paste it into your main CSS file after @import "tailwindcss"; to get classes such as bg-brand-1, text-brand-1 and fill-brand-1 (Tailwind theme variables). Rename the variable first: the default name, color, produces bg-color-1.
GIMP / Inkscape palette (.gpl) downloads palette.gpl. In GIMP, open Windows > Dockable Dialogs > Palettes, right-click the list and choose Import Palette (GIMP Palettes dialog). In Inkscape, copy the file into the User palettes folder shown under Edit > Preferences > System and restart; in Krita, use import resources in the Palette docker. JSON suits scripts, and Download PNG swatches saves a labeled image of the palette.
Other ways to get a color code from an image
These free desktop tools read the color under your pointer.
| Where | Tool | How to get the code |
|---|---|---|
| Windows | PowerToys Color Picker | Press Win+Shift+C and click; HEX is copied by default |
| Mac | Digital Color Meter | Hover, then press Shift-Command-C to copy the values |
| GIMP | Pointer dialog | Windows > Dockable Dialogs > Pointer, with a readout set to RGB |
| Chrome | DevTools color picker | Its eyedropper samples the page or the whole screen |
In Digital Color Meter, choose sRGB in the color space pop-up menu to match web colors, and drag the aperture slider to its smallest size, since a larger aperture averages the pixels inside it.
Troubleshooting
The HEX code changes with every click
Photos, gradients and JPEG files rarely have two identical neighboring pixels, and edges blend into the background. Click the middle of a flat area, or use that region's palette swatch, which stands for the whole group.
The code doesn't match the brand guide or another app
Zutilium reads pixels in sRGB after the browser converts the image, so a photo with a wide-gamut profile such as Display P3 or Adobe RGB gives different numbers here than in an app showing values in that profile. Other pickers may average an area, and some privacy settings, such as fingerprinting protection, add slight random noise to the pixels a page reads (MDN). For brand work, use the codes in the brand guidelines and let a picker confirm them.
A thin line or small detail reads as a blend
Images over 1,600 pixels on the longer side are shown scaled down, so one preview pixel mixes several image pixels. Crop the area to 1,600 pixels or less with Advanced Photo Editor, which also runs in your browser, export a PNG and open that instead.
The picked color doesn't match where you tapped
On tall images such as phone screenshots, the tool can read a pixel beside the one you tap. Crop to the area you need first, or check that the chip matches the color you meant.
A color you can see is missing from the palette
Small areas lose out to large ones, and a detail only a few pixels wide may vanish from the 320-pixel copy. Choose Vivid colors, raise Number of colors, or click the color and press Add to palette.
The image won't open or is too large
The limits are 50 MB, 60 megapixels and 16,384 pixels per side. iPhone photos in HEIC format may need converting first: HEIC Converter makes a JPG on Zutilium's server, and the guide to converting HEIC to JPG covers other methods. Image Resizer shrinks an image over 60 megapixels (up to 100) on the server if the file is under 30 MiB; a file over 50 MB needs resizing in a desktop editor first.
There is no Pick from screen button
It appears only in browsers that support the EyeDropper API: as of November 2026, desktop Chrome, Edge and Opera. Elsewhere, copy a screenshot to the clipboard and paste it with Ctrl+V or ⌘V (on a Mac, add Control to the screenshot shortcut; on Windows, Print Screen copies the whole screen), or on a phone open one with Choose an image.
Frequently asked questions
How do I get a HEX color from a picture on my phone?
Open Color Palette Generator from Image in your phone's browser, tap Choose an image, select the photo or screenshot and tap the spot you want. Copy puts the HEX code on the clipboard, and the image is processed on the phone itself.
How do I extract colors from an image?
Use a palette extractor: it samples the image, groups similar pixels and returns one representative color per group with its share. Ask for about 6 colors for a photo and fewer for a logo, then copy or export the codes.
How do I find the HEX code of a color on a website?
Open Chrome DevTools, select the element and look in the Styles pane, where each color value has a small swatch that opens the color picker. The CSS gives the exact value the designer set, which is more reliable than sampling a screenshot.
Can a HEX code include transparency?
Yes. CSS accepts eight-digit codes such as #2A78D680, where the last pair sets the opacity, and a four-digit short form. This tool always returns the solid six-digit color: pixels less than half opaque are skipped, and clicking one shows a message instead of a code.