Image Tips

How to Pick a Color From an Image and Copy the HEX, RGB or HSL Code

You have a picture with the exact colour you need and no way to name it. Click the spot, copy the code, and use it in your design or CSS. A few details decide whether the value is trustworthy.

👉 Try it free: Image Color Picker: click a pixel, copy the code
Add an image, click any spot and copy its HEX, RGB or HSL value. Everything stays in your browser.

Pick a colour from any image

  1. Open Image Color Picker and add a JPEG, PNG or WebP file with Select Image.
  2. Click the spot you want on the preview. The status line confirms the pixel, for example "Picked pixel at (212, 88)".
  3. Read the swatch and the three values: HEX, RGB and HSL.
  4. Press Copy beside the format you need. The button shows "Copied!" for a moment.

Which code to copy

FormatExampleUse it in
HEX#2F6FDECSS, design tools, brand guides, most colour fields
RGBrgb(47, 111, 222)CSS, code, and any tool that asks for three channel values
HSLhsl(219, 74%, 52%)CSS when you want to adjust lightness or saturation by hand

The HEX code is written in capital letters with a leading hash, as in #2F6FDE, which pastes straight into CSS and most design programs. HSL is helpful if you plan to make a lighter or darker variation: change only the last number and the hue stays the same.

Why the colour may not match what you expected

Three things explain most complaints that "the code is slightly off".

The tool reads a single pixel per click. It does not build a palette, so to collect five colours, click five times and copy each as you go.

Transparent pixels

If you click a semi-transparent area of a PNG or WebP, the status line adds the alpha, as in "alpha: 50%", and the RGB and HSL fields switch to rgba() and hsla() forms with an opacity value. The HEX field stays a plain six-digit code that does not include transparency. So for a see-through pixel, copy the RGB or HSL version if you need to keep the opacity.

Getting reliable brand colours

  1. Start from the best source you have: a PNG or the original design file, not a photo of a logo.
  2. Click the middle of a large solid area, away from edges and anti-aliased borders.
  3. Pick the same area twice. If the values agree, the area is flat and the sample is dependable.
  4. Paste the value into your design tool and compare it against the original on screen.

If the brand has an official colour specification, use that over a sampled value. A colour picked from a screenshot or a web image reflects how that file was exported, and printing from screen values can look different on paper.

A short note on screens and printing

The code you copy describes what is stored in the file, not how it will look. Different monitors, brightness settings and colour profiles show the same code a little differently, and ink on paper is another matter altogether. For screen work, such as websites and slides, the sampled code is usually all you need. For print, ask the printer for their colour requirements and treat a sampled value only as a starting point.

Common uses

If the image will not load or looks wrong

The image is read in your browser with the canvas and is not uploaded, so you can sample colours from files you would rather keep private.

Frequently Asked Questions

Which image formats can I pick colours from?

JPEG, PNG and WebP files. Convert HEIC or AVIF images first.

Why is the colour slightly different from the original artwork?

The preview is scaled to at most 600 pixels wide, and JPG compression shifts pixels. Click in a large flat area of a PNG for the most reliable value.

Can it build a colour palette automatically?

No. It samples one pixel per click. Click each area you want and copy the values.

How are transparent pixels handled?

The status line shows the alpha percentage, and RGB and HSL switch to rgba and hsla forms. HEX stays a plain six-digit code without transparency.

Does the picker upload my image?

No. The image is read in your browser using a canvas.

What does the HEX code look like?

A hash followed by six capital letters or digits, such as #2F6FDE.