Color Picker from Image

Upload a photo or screenshot, click any pixel and get its HEX, RGB and HSL values with one-click copy and a history of your last 10 picks.

The interactive tool loads here when JavaScript runs.

About this tool

What is the Color Picker from Image?

The Color Picker from Image is an eyedropper for pictures you upload. Load a photo, screenshot or mockup, click Enable Color Picker, then click anywhere on the image. The tool reads that exact pixel from the full-resolution image and shows it as HEX, RGB and HSL, each with a copy button, plus the pixel coordinates it sampled.

Your last ten picks stay in a Color History row, so you can collect a small palette from one image and click back through it. If you click a partly transparent pixel, the alpha value is shown as well, because HEX and RGB alone would hide it.

The image is read with a local canvas and never uploaded. The tool samples one pixel at a time; it does not average an area or extract a dominant-colour palette automatically, so on noisy photos it is worth picking a few neighbouring points.

  • Samples the exact pixel at full image resolution
  • HEX, RGB and HSL with one-click copy
  • Alpha shown for partly transparent pixels
  • History of the last 10 picks
  • Runs in your browser; the image is not uploaded
Read the guide: Pulling Colours and Fonts Out of an Image: What Works and What Does Not

Updated

How to use the Color Picker from Image

  1. Click the upload area and choose an image (JPEG, PNG, WebP, GIF or anything else your browser can display, up to 10 MB).
  2. Click Enable Color Picker. The button changes to "Click on image to pick color" and the cursor becomes a crosshair.
  3. Click the pixel you want. Its swatch, HEX, RGB, HSL and pixel position appear in the Color Information panel.
  4. Click the HEX, RGB or HSL value to copy it in CSS-ready form, such as rgb(51, 102, 204) or hsl(220, 60%, 50%).
  5. Enable the picker again for the next colour. Click any swatch in Color History to bring back an earlier pick, or use the reset button to load a different image.

Worked examples

A brand blue from a screenshot

Input

Click a pixel with RGB 51, 102, 204

Output

HEX #3366cc, rgb(51, 102, 204), hsl(220, 60%, 50%)

Blue is the largest channel, so the hue lands in the blue range (220 degrees). Lightness is the midpoint of the largest and smallest channel: (204 + 51) / 2 / 255 = 50%.

An orange from a product photo

Input

Click a pixel with RGB 255, 136, 0

Output

HEX #ff8800, rgb(255, 136, 0), hsl(32, 100%, 50%)

With one channel at 255 and one at 0, saturation is 100% and lightness exactly 50%. Real photos rarely give values this clean; sample two or three nearby pixels and pick the one that matches what you see.

Background and insight

A displayed image is usually scaled, so the pixel under your cursor is not the pixel at the same position in the file. The picker converts the click position from CSS pixels to the image's natural pixels, and accounts for the empty bars that appear when a tall image is shown in a wide box (object-fit: contain). Clicks on those bars are ignored instead of sampling the wrong spot. Screen density does not matter here, because both the click position and the element size are measured in CSS pixels.

HEX and RGB are the same numbers in different bases: #3366cc is red 0x33 = 51, green 0x66 = 102, blue 0xcc = 204. HSL re-expresses them as hue (an angle from 0 to 359), saturation and lightness, which is easier to reason about when you want "the same colour but darker". HSL values are rounded to whole numbers, so converting HSL back to RGB can be off by one in a channel. Treat HEX or RGB as the source of truth.

Colour management can shift values slightly. Browsers convert images with embedded profiles (for example Display P3 photos from recent phones) into sRGB before a canvas sees them, so the numbers here are sRGB values and can differ by a few units from what a desktop editor reports for the raw file. JPEG compression also makes neighbouring pixels in a "flat" area differ by a few units.

Common use cases

  • Matching a client's brand colour

    Pull the exact HEX value from a logo or old website screenshot when nobody can find the brand guidelines.

  • Building a palette from a photo

    Pick sky, skin, foliage and shadow tones from a reference image and keep them in the history row while you work.

  • Checking a design implementation

    Compare a pixel in a screenshot of the live site with the value in the design file to catch a wrong token.

  • Feeding a contrast check

    Grab the text and background colours from a screenshot and paste them into a contrast checker.

Tips and limitations

  • For flat UI colours, use a PNG screenshot rather than a JPEG. JPEG artefacts make a solid button vary by a few units from pixel to pixel.
  • Anti-aliased edges blend two colours. Click well inside a shape, not on its border.
  • The picker turns off after each click. Press Enable Color Picker again before the next pick.
  • If a value looks slightly different from your design tool, check whether the source image has a colour profile; the browser converts it to sRGB.
  • Uploading a new image clears the history, so copy the values you need first.

Sources and further reading

  1. CanvasRenderingContext2D: getImageData() method, MDN Web Docs. Reading pixel values from a canvas
  2. object-fit, MDN Web Docs. How contain leaves empty bars around a scaled image
  3. hsl(), MDN Web Docs. Hue, saturation and lightness

Frequently asked questions

How do I get the HEX code of a color in an image?

Upload the image, click Enable Color Picker, then click the colour. The HEX value appears in the Color Information panel; click it to copy. The value comes from the exact pixel in the original image, not from the scaled preview.

Why is the picked color slightly different from my design file?

Usually because of JPEG compression or colour management. JPEG changes flat areas by a few units per pixel, and browsers convert images with Display P3 or other profiles into sRGB before reading them. Use a PNG export and sample the middle of a shape.

Does the image color picker work on transparent PNGs?

Yes. Fully transparent pixels read as RGB 0, 0, 0 with alpha 0, and partly transparent pixels show their alpha next to the colour. HEX and RGB report only the colour channels, so check the alpha line before using a value.

Can it extract a whole color palette automatically?

No. This tool samples one pixel per click and keeps the last ten in a history row. Automatic palette extraction clusters thousands of pixels into a few averages; here you choose the exact points yourself.

Are HSL values from the picker exact?

They are rounded to whole degrees and percentages, which is how CSS usually writes them. Converting the rounded HSL back to RGB can differ by one unit in a channel, so use the HEX or RGB value when you need an exact match.

Is my image uploaded when I pick colors?

No. The file is opened with a local object URL and drawn to a hidden canvas in your browser. Only anonymous usage events, such as "colour picked", are recorded; the image itself stays on your device.

Is there an in-depth guide to the Color Picker from Image?

Yes. “Pulling Colours and Fonts Out of an Image: What Works and What Does Not” covers the background, how it works, common pitfalls and worked examples. Read the full guide.