How to Find the Exact Colour Code of Any Pixel in an Image

Get HEX, RGB and HSL codes from a photo, logo or screenshot, understand why the same colour can read differently, and build a palette from an image.

Updated September 29, 2026 5 min read

Use the free Image Color PickerPick HEX, RGB and HSL colours and palettes from any image

You need to match a colour exactly. A client's old logo exists only as a JPG and nobody has the brand guidelines. A mood-board photo has the perfect shade of green for a new presentation. A screenshot of a competitor's button needs to be recreated for a mock-up. Guessing by eye never quite works: two greens that look identical side by side can be several shades apart in code.

This guide explains the three colour notations you will meet (HEX, RGB and HSL), how to sample a pixel accurately, why the "same" colour can give slightly different codes in different parts of an image, and how to pull a whole palette from a picture.

HEX, RGB and HSL: the same colour, three ways

Screens build every colour from red, green and blue light, each with an intensity from 0 to 255. The three common notations are simply different ways of writing those values.

Notation Example Best for
HEX #2E86C1 CSS, design tools, brand guidelines
RGB rgb(46, 134, 193) Code that manipulates channels, office software colour dialogs
HSL hsl(204, 62%, 47%) Creating lighter, darker or muted variants

HEX is RGB in hexadecimal: 2E is 46, 86 is 134 and C1 is 193. HSL describes the colour as a hue angle on the colour wheel (0-360), a saturation percentage and a lightness percentage. HSL is handy when you want a hover state 10% darker: keep hue and saturation, lower the lightness.

To convert between these and other notations, use the Color Converter.

Why a colour can read differently across an image

JPEG compression adds noise

JPEG stores colour in 8 × 8 pixel blocks and at lower resolution than brightness. The result is that a flat area of logo blue in a JPG is often a mixture of slightly different blues. Sampling two pixels a few millimetres apart can give #2E86C1 and #2F85C3.

Edges are blends

Where a coloured shape meets its background, anti-aliasing mixes the two colours to smooth the edge. Pixels along the boundary are intermediate shades, not the brand colour.

Photos contain light, not paint

In a photo of a painted wall or a product, lighting, shadows and camera white balance change every pixel. The code you pick is the colour of that pixel in that photo, which may be quite different from the real paint or fabric.

Colour profiles

Images can carry a colour profile (for example Display P3 from recent phones). Browsers convert them for display, so a picked value reflects how your browser rendered the image. For brand-critical work, confirm against official specifications.

Pick colours with our tool

The Image Color Picker works on the image in your browser; nothing is uploaded.

  1. Open Image Color Picker and drop a PNG, JPG, WebP, GIF or SVG, or click to choose one.
  2. Move the pointer over the image. A zoom loupe follows it, magnifying the pixels under the cursor and showing the HEX value live, so you can see exactly which pixel you are on.
  3. Click (or tap on a phone) to pick. The panel shows the colour's HEX, RGB and HSL values, each with its own copy button.
  4. Keep clicking to compare areas. Your earlier choices appear under Recent picks; click one to bring its values back.
  5. Scroll to Dominant colour palette for the main colours of the whole image, shown as a proportional bar. Choose 6, 7 or 8 colours and use Copy all to copy the HEX codes in one go.

Getting a clean reading

  • Sample from the middle of a flat area, not the edge of a shape.
  • If you get slightly different codes nearby, pick three or four points and use the most common value, or the palette's matching colour, which averages similar pixels.
  • Prefer the highest-quality source you have. A PNG or SVG logo gives exact values; a screenshot of a compressed JPG does not.

Other ways to pick a colour

Built into your system

  • Windows: Microsoft PowerToys includes a Color Picker utility (by default Win + Shift + C) that samples anything on the screen.
  • macOS: the built-in Digital Color Meter app shows the values under the cursor, and the system colour panel in many apps has an eyedropper.
  • Browsers: developer tools include an eyedropper in the CSS colour editor for sampling web pages.

These are excellent for colours on screen right now. A dedicated image picker is easier when you want a loupe, a history and a palette from a file.

Design software

Photoshop, GIMP, Figma and similar tools have eyedroppers with a "sample size" option that averages a 3 × 3 or 5 × 5 area, which smooths out JPEG noise. If you already work in one of them, that averaging feature is genuinely useful.

Using the codes you found

  • Check legibility. A brand colour used for text must contrast enough with its background. Test pairs with the Color Contrast Checker.
  • Build a scheme. For a full set of harmonious colours from a photo, the Color Palette from Image tool focuses on palette extraction.
  • Set up a favicon or social image in the brand colour with the Favicon Generator.
  • Browse named colours in the HTML Color Codes reference if you want a close standard name.

Frequently asked questions

How do I get the HEX code of a colour in a picture?

Open the image in a colour picker, click the area you want and copy the HEX value. Sample from the centre of a flat area for the most accurate result.

Why do I get slightly different codes for the same colour?

JPEG compression, anti-aliased edges and lighting all create small variations between neighbouring pixels. Sample several points and use the most common value.

Is the picked colour the same as the printed or painted colour?

Not necessarily. A photo records light under specific conditions, so the code matches that pixel on screen, not the physical material. Use official colour references for print or paint.

What is the difference between HEX and RGB?

They describe the same values. RGB writes the red, green and blue channels as numbers from 0 to 255, while HEX writes the same three numbers in hexadecimal.

Can I pick colours from a screenshot?

Yes. Save the screenshot as PNG for exact colours and open it in the picker. PNG avoids the compression noise a JPG screenshot would add.

Try it now: Image Color Picker

Loading tool…