How to Pick a Color From an Image (HEX and RGB Codes)

To grab an exact pixel color from any photo, logo, or screenshot, open the Image Color Picker, upload your image, and click the spot you want to read its HEX and RGB values. If you want the overall color scheme instead of one pixel, use the Color Palette Generator to pull up to 8 dominant swatches in one click.

Which Color Tool Should You Use?

Sampling one specific pixel and summarizing an entire photo are two different jobs. Use this table to pick the right tool before you start:

I need Use You get
One exact pixel color (logo, button, UI background) Image Color Picker Live preview swatch plus exact HEX: and RGB: values
Overall color scheme of a photo or design Color Palette Generator Up to 8 dominant color swatches with click-to-copy HEX codes
Color of a thin 1px border or tiny icon Image Color Picker with the browser page zoomed in A bigger target: zoom the page with Ctrl or Cmd and the plus key, and the click still maps to the true image pixel
To shift hues, saturation, or contrast of a graphic HSL Adjuster Recolored PNG using separate Hue, Saturation, and Lightness sliders

How to Pick One Exact Color From an Image

Step 1Upload your image

Open the Image Color Picker and click Upload Image to Pick Color, or drag any JPG, PNG, or WebP file onto the drop box. The image opens inside a scrollable canvas with a crosshair cursor.

Step 2Click the pixel you want to sample

Click or tap the exact area you want to inspect. Even if CSS scales the preview down to fit your screen, the tool maps your click back to the image's true pixel coordinates and reads that single pixel directly from the decoded image data.

Step 3Copy the HEX and RGB codes

Look at the result card beneath the canvas. The preview square updates to your sampled color and shows two text readouts: HEX: (for example #2e86ab) and RGB: (displayed as three numbers, such as 46, 134, 171). Note that the picker outputs HEX and RGB only (no HSL or CMYK), and you select and copy the text you need directly from the card.

Image Color Picker after clicking a red panel of a balloon: the swatch shows the colour with HEX #e23636 and RGB 226, 54, 54

Sample exact pixel colors in your browser

Reads decoded pixel data straight from your JPG, PNG, or WebP.

Open Image Color Picker

How to Extract a Color Palette (Up to 8 Swatches)

When you want the whole mood of an image rather than one point, use the Color Palette Generator:

  1. Click Select Image to Find Color Palette and choose a JPG, PNG, or WebP file.
  2. Wait a split second while ColorThief (an in-browser quantization library that groups similar pixels together) builds the palette under Extracted Palette (Click Swatch to Copy Hex). You receive up to 8 swatches ordered roughly from the largest color groups to smaller ones (or 1 swatch if the image is a single solid color).
  3. Click any swatch, or tab to it and press Enter or Space, to copy its HEX code to your clipboard. The label changes to Copied! for 1.5 seconds and announces the code below the row. If your browser blocks clipboard access, the status line prints the HEX code so you can copy it manually.
Color Palette Generator showing eight extracted swatches with their HEX codes above the source photo

Why the Same Logo Gives Different Codes in Different Spots

If you click three spots on a solid blue brand badge and get #1c64f2, #1e66f0, and #749cf5, the picker is not broken. Two file-level effects alter neighboring pixels:

How to sample accurately: Whenever possible, pick from a lossless PNG screenshot or export instead of a compressed JPG. Click dead center inside the thickest solid region, well away from edges and shadows. If the detail is tiny, zoom the browser page in (Ctrl or Cmd and the plus key) so the pixel becomes a bigger target; the picker still reads the true image pixel. An image wider than the preview pane is shown scaled down, so crop it first in the Image Cropper to work on it at full size. On natural photos (skin, sky, fabric), sample three or four spots in the same area to see the typical range.

Converting HEX to RGB by Hand: One Worked Example

HEX (hexadecimal, base-16) and RGB (Red, Green, Blue, base-10 from 0 to 255) represent the exact same numbers in two notations. Every two characters in a six-digit HEX code equal one RGB channel, using digits 0-9 plus letters A=10, B=11, C=12, D=13, E=14, F=15.

Here is how to convert #2E86AB by hand:

  1. Split into three pairs: Red = 2E, Green = 86, Blue = AB.
  2. Multiply the first digit by 16 and add the second digit:
    • Red (2E): (2 x 16) + 14 = 32 + 14 = 46
    • Green (86): (8 x 16) + 6 = 128 + 6 = 134
    • Blue (AB): (10 x 16) + 11 = 160 + 11 = 171
  3. Write the RGB result: rgb(46, 134, 171).

Using Picked HEX and RGB Codes in CSS

Once you copy the values from the picker or palette swatches, store them as CSS custom properties in :root so you only change them in one place. Keep HEX for solid colors and use the RGB numbers when you want built-in transparency with modern CSS slash syntax:

:root { --brand-primary: #2e86ab; --brand-surface: rgb(46 134 171 / 0.12); } .button-primary { background-color: var(--brand-primary); color: #ffffff; } .callout-banner { background-color: var(--brand-surface); border-left: 4px solid rgb(46, 134, 171); }

For a complete workflow covering how to structure extracted colors into dominant, secondary, and accent roles, plus contrast checking, see a color workflow: extract, build, adjust.

Common Mistakes When Sampling Colors

Nothing Is Uploaded

Both the Image Color Picker and the Color Palette Generator decode your image onto a local canvas inside your browser tab. Unreleased brand designs, client mockups, and private screenshots never leave your device.

Frequently Asked Questions

Which color formats does the Image Color Picker output?

It outputs HEX and RGB only, alongside a live color swatch preview. It does not output HSL or CMYK values.

How many colors does the Color Palette Generator extract?

It extracts up to 8 dominant color swatches from the image, or 1 swatch if the image is a single flat color. Clicking any swatch copies its HEX code to your clipboard.

Why do two spots on the same logo give slightly different HEX codes?

JPEG compression creates slight color shifts across flat areas, and anti-aliasing blends edge pixels with the background color. Sample from the solid center of a shape, and use a PNG screenshot when possible.

How do I pick a color from a thin line or tiny icon?

Zoom the browser page in with Ctrl or Cmd and the plus key so the detail is a bigger target. The picker maps your click back to the true image pixel. If a large image is shown scaled down, crop it first with the Image Cropper.

Can I convert a HEX code to RGB by hand?

Yes. Split the six-character HEX code into three two-digit pairs for red, green, and blue, then convert each base-16 pair to a decimal number between 0 and 255.

Ready to grab your exact color codes?

Open Image Color Picker
← All How-To Guides