TapCub is live — analytics, insights and live chat, free on one platform

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.

Pick

No image yet. Choose, drop or paste one, or try the sample image.

Current colour

Click the image to pick a colour.

HEX—
RGB—
HSL—
CMYK—

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.css

    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.

    Palette of the sample illustration
    ColourShare of pixelsRGBContrast on white / black
    #F4C27A30%rgb(244, 194, 122)1.63:1 / 12.84:1
    #15716826%rgb(21, 113, 104)5.84:1 / 3.59:1
    #83B9FC15%rgb(131, 185, 252)2.03:1 / 10.31:1
    #488CF714%rgb(72, 140, 247)3.29:1 / 6.36:1
    #66A2F914%rgb(102, 162, 249)2.59:1 / 8.10:1
    #FFFFFF1.6%rgb(255, 255, 255)1.00:1 / 21.00:1
    palette.css
    :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.

    Your files never leave this device: they are read and converted by your browser, and nothing is uploaded to TapCub or anyone else. To check, open your browser’s developer tools, go to the Network tab and run the tool: no file is sent.

    Version v1.0Updated Update history

    Read the result

    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.

    How to use it

    Pick a colour from an image in four steps

    Works with screenshots, photos, logos and design exports.

    1. 1

      Open the image

      Choose a file, drop it on the box or paste a screenshot with Ctrl+V or Cmd+V.

    2. 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. 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. 4

      Copy or export

      Copy any code, or export the dominant colours or your picked colours as CSS variables, JSON or Tailwind.

    How it works

    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
    One colour in every format
    FormatExampleUsed in
    HEX#0F766ECSS, Figma, brand guides
    RGBrgb(15, 118, 110)CSS, image editors
    HSLhsl(175.3, 77.4%, 26.1%)CSS, making tints and shades
    CMYKcmyk(87%, 0%, 7%, 54%)Print briefs (approximate)
    Worked example

    The sample beach illustration

    Open the sample image and look at its dominant colour.

    From pixels to a palette
    StepWhat happensResult
    1. Sample640 × 400 image, every 3rd pixel in each directionAbout 28,000 pixels
    2. Median cutSplit the colour cube until there are 6 boxes6 starting colours
    3. k-meansReassign pixels to the nearest colour, 6 roundsStable colours and shares
    4. Top colourThe largest group#F4C27A, 30% of the image
    5. Contrast#F4C27A as text1.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.

    Common mistakes

    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.

    FAQ

    Color 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.

    Changelog

    Update history

    New features, fixes and data refreshes for this tool, newest first.

    1. · 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

    See your data clearly. Find your growth.

    Every click, backed by data. Install one line of code and see your first numbers in a minute.

    No credit card · Free plans for analytics and chat · Cookieless analytics