Free tool · Files Color picker from image: get the exact colour of any pixel
Open a photo, screenshot or logo and click where you want the colour. A magnifier shows the pixels under the cursor, and you get the code in HEX, RGB, HSL and CMYK plus its contrast against white and black. The main colours of the whole image are extracted as a palette you can export to CSS, JSON or Tailwind.
- Images stay on your device
- Pixel-exact, with magnifier
- Palette to CSS or Tailwind
Pick colours from an image
Open an image, then click it. Use the arrow keys on the image for single-pixel steps and Enter to pick.
No image yet. Choose, drop or paste one, or try the sample image.
Hover to magnify, click to pick. On the image: arrow keys move one step (Shift for ten), Enter or Space picks.
Current colour
Click the image to pick a colour.
————As text on white
Aa—
As text on black
Aa—
WCAG 2.2: 4.5:1 for body text (AA), 3:1 for large text and icons.
Picked colours
Dominant colours
- Open an image to see its main colours.
Palette of the sample illustration
A simple beach scene (sky gradient, sea, sand, sun, palm trunk), 6 colours. Click “Try a sample image” to open the same picture.
| Colour | Share of pixels | RGB | Contrast on white / black |
|---|---|---|---|
| #F4C27A | 30% | rgb(244, 194, 122) | 1.63:1 / 12.84:1 |
| #157168 | 26% | rgb(21, 113, 104) | 5.84:1 / 3.59:1 |
| #83B9FC | 15% | rgb(131, 185, 252) | 2.03:1 / 10.31:1 |
| #488CF7 | 14% | rgb(72, 140, 247) | 3.29:1 / 6.36:1 |
| #66A2F9 | 14% | rgb(102, 162, 249) | 2.59:1 / 8.10:1 |
| #FFFFFF | 1.6% | rgb(255, 255, 255) | 1.00:1 / 21.00:1 |
:root {
--color-1: #f4c27a; /* 30% */
--color-2: #157168; /* 26% */
--color-3: #83b9fc; /* 15% */
--color-4: #488cf7; /* 14% */
--color-5: #66a2f9; /* 14% */
--color-6: #ffffff; /* 1.6% */
}The sky gradient is split into several blues because it covers a large area; small details such as the palm trunk merge into a neighbouring colour unless you ask for more colours.
Version v1.0Updated Update history
What the colour codes mean
All codes describe the same sRGB colour, the one your browser draws on screen.
HEX and RGB
The red, green and blue values from 0 to 255. HEX is the same three numbers in base 16 (#RRGGBB) and is what CSS, design tools and most brand guides use.
HSL
Hue (0–360°), saturation and lightness. Handy for making lighter or darker versions of a picked colour: keep the hue, change the lightness.
CMYK
A simple conversion for print (no colour profile). Treat it as a starting point; the printer’s profile decides the real ink values.
Contrast
How readable the colour is as text on white and on black, by the WCAG 2.2 formula. 4.5:1 passes AA for body text, 3:1 for large text and icons.
Palette shares
Each dominant colour’s share of the image’s opaque pixels. Gradients split into several shades; tiny details only appear with more colours.
Averaging
JPEG and photos have noisy pixels. A 3 × 3 or 5 × 5 average gives the colour the eye sees rather than one odd pixel.
Images with a wide-gamut profile (Display P3 photos from recent phones) are converted to sRGB by the browser before the pixels are read, so very saturated colours can come out slightly different from what a P3 screen shows.
Pick a colour from an image in four steps
Works with screenshots, photos, logos and design exports.
-
1
Open the image
Choose a file, drop it on the box or paste a screenshot with Ctrl+V or Cmd+V.
-
2
Aim with the magnifier
Move over the image; the magnifier shows 11 × 11 pixels around the point. On a keyboard, focus the image and use the arrow keys.
-
3
Click to pick
The colour becomes the current colour with HEX, RGB, HSL and CMYK codes, and is added to your picked colours.
-
4
Copy or export
Copy any code, or export the dominant colours or your picked colours as CSS variables, JSON or Tailwind.
How pixels become colour codes and a palette
The image is drawn onto a canvas in your browser and its pixels are read directly; nothing is sent anywhere.
- Picking: the RGB values of the pixel under the cursor, or the average of a 3 × 3 to 9 × 9 square around it (transparent pixels weighted by their alpha)
- HSL and CMYK are converted from RGB with the CSS Color 4 formulas, the same code as the colour converter on this site
- Contrast = (L1 + 0.05) ÷ (L2 + 0.05), where L is relative luminance from WCAG 2.2; ratios are shown truncated, never rounded up to pass
- Palette: about 40,000 evenly spaced pixels are sampled, split by median cut (Heckbert, 1982) into the number of colours you chose, refined with six rounds of k-means, and near-identical colours merged
- No random numbers are used, so the same image always gives the same palette
| Format | Example | Used in |
|---|---|---|
| HEX | #0F766E | CSS, Figma, brand guides |
| RGB | rgb(15, 118, 110) | CSS, image editors |
| HSL | hsl(175.3, 77.4%, 26.1%) | CSS, making tints and shades |
| CMYK | cmyk(87%, 0%, 7%, 54%) | Print briefs (approximate) |
The sample beach illustration
Open the sample image and look at its dominant colour.
| Step | What happens | Result |
|---|---|---|
| 1. Sample | 640 × 400 image, every 3rd pixel in each direction | About 28,000 pixels |
| 2. Median cut | Split the colour cube until there are 6 boxes | 6 starting colours |
| 3. k-means | Reassign pixels to the nearest colour, 6 rounds | Stable colours and shares |
| 4. Top colour | The largest group | #F4C27A, 30% of the image |
| 5. Contrast | #F4C27A as text | 1.63:1 on white, 12.84:1 on black |
Shares are counted on the sampled pixels, so they can differ from an exact pixel count by a fraction of a percent.
Where picking colours goes wrong
Most wrong colours come from the image, not the picker.
Picking from a compressed JPG
Edges and flat areas in JPGs carry noise. Use a 3 × 3 or 5 × 5 average, or a PNG export of the design.
Picking an anti-aliased edge
The pixels at the edge of text or a logo are a blend with the background. Zoom in with the magnifier and pick from the middle of the shape.
Taking the palette as the brand colours
The palette ranks colours by area. A small logo in the corner may not appear at all; pick it directly or raise the number of colours.
Using a colour for text without checking contrast
A brand colour that looks fine as a button can fail as body text. Check the contrast figures before you use it on white or black.
The same privacy-first approach in our analytics
This tool reads your image on your device. TapCub applies the same idea to analytics: collect what you need, keep personal data out.
Cookieless visitor ID
Visitors are told apart by a keyed hash of the site, a salt, the IP address and the browser type. Nothing is written to the browser and the IP is never stored.
Learn moreCompliance centre
Choose balanced or strict, switch on IP truncation for some regions only, set the geography level and retention.
Learn moreSafeguards
Encryption in transit, sensitive fields encrypted at rest, masking by role, export and deletion of one person's data.
Learn moreColor picker from image questions
Still have a question?
Chat with the team behind TapCub — we usually reply within a few hours on business days.
How do I pick a colour from an image?
Open the image here, move over it to see the magnifier and click the spot you want. The HEX, RGB, HSL and CMYK codes appear next to the image with copy buttons.
How do I get the HEX code of a colour in a picture?
Click the colour in the image; the HEX code is the first line under Current colour. For photos, set Sample to 3 × 3 or 5 × 5 so one noisy pixel does not throw the value off.
Can I pick a colour from anywhere on my screen?
In Chrome and Edge on a computer, yes: click Pick from screen and then click anything on your screen, including other windows. Other browsers do not support this yet, so take a screenshot and paste it here instead.
How do I get a colour palette from an image?
Open the image and the main colours appear on the right with their share of the image. Choose 4 to 12 colours, then export them as CSS variables, JSON or Tailwind config.
Why is the picked colour different from what I expected?
Usually because of compression noise, anti-aliased edges, or a colour profile: phone photos in Display P3 are converted to sRGB before the pixels are read. Average a few pixels and pick from the middle of a flat area.
Is my image uploaded?
No. The image is drawn and read by your browser, and the page sends nothing about it. You can check in the Network tab of your browser’s developer tools.
Does it work on iPhone and Android?
Yes. Open an image from your gallery, then tap or drag on it: the magnifier follows your finger and the colour is picked when you lift it.
Update history
New features, fixes and data refreshes for this tool, newest first.
-
· v1.0
LaunchedFirst release.
Missing something or found an error? Tell us — requests that come up often go into the next update. All tool updates
Analytics that keep personal data out
TapCub counts visits without cookies and never stores IP addresses, with a compliance centre for stricter regions.