Image Color Picker
Upload an image and pick colors in HEX, RGB, and HSL with a visual color history.
Reviewed by Aygul Dovletova · Last reviewed
Drop an image here or click to upload
Click anywhere on the image to pick a color
How to Use the Image Color Picker
- Upload an image - drag a file onto the dropzone or click to choose. JPEG, PNG, WebP, GIF, AVIF, and BMP all work; any format your browser can display is accepted.
- Move the cursor over the image to see the live color readout update pixel by pixel.
- Click a spot to lock that color and add it to the history panel. The detail panel shows HEX, RGB, and HSL.
- Click any row in the detail panel (HEX, RGB, or HSL) to copy it to your clipboard. Click a history swatch to copy its HEX value directly.
- Continue clicking to build a palette of up to 20 sampled points; oldest entries roll off when the history fills.
How the Eyedropper Reads Pixels
When you upload an image the tool draws it into an off-screen HTML <canvas> element at the image\'s natural dimensions. Moving the cursor over the displayed image calculates the corresponding canvas coordinate (using the current DOM size vs. the natural size ratio) and calls CanvasRenderingContext2D.getImageData(x, y, 1, 1), which returns a four-byte Uint8ClampedArray containing the red, green, blue, and alpha values of that one pixel. Those four bytes are converted to the three display formats: HEX via hex-string formatting, RGB via template literal, HSL via the CSS Color Module Level 4 conversion. Because getImageData reads directly from the decoded pixel buffer, the values are byte-accurate to the source file - no rendering-layer interpolation, no color-profile transformation, no lossy sampling. The only caveat is that the canvas must be "tainted"-free, which it is as long as the image is loaded from a same-origin or CORS-enabled source; the file upload path always satisfies this.
When the Eyedropper Is the Right Tool
- Extracting brand colors from a screenshot of a competitor\'s site when you cannot see the CSS.
- Matching UI colors to a photograph - grabbing the exact teal of an ocean shot or the warm ochre of a sunset for a hero section.
- Building a palette from a mood board: upload the board, click the dominant tones, and export the history as a palette.
- Reverse-engineering a design file when the client handed over a PNG export instead of the editable source.
- Identifying the tint of a print asset - photograph a printed piece, upload, sample the brand color, and convert to CMYK for the next print run.
Pitfalls and Sampling Caveats
First, JPEG compression: 8x8 block quantization can shift a single pixel several units up or down, so sampling one point gives you the compressed value rather than the original color. Sample adjacent pixels and average, or re-acquire in PNG if accuracy matters. Second, sRGB assumption: pixel bytes are interpreted as sRGB. Photographs tagged Display P3 or Adobe RGB have profiles the browser honors at render time but that getImageData does not apply - the raw bytes are stored bytes, not displayed color. Third, animated GIFs and video: the canvas captures the first frame of a GIF, and video sources are not supported. Fourth, retina scaling: the displayed image is scaled to fit the viewport, so a cursor pixel corresponds to multiple source pixels; the tool converts coordinates correctly, but enlarge the image for high-precision sampling.
The Canvas and File API Behind the Tool
The browser\'s File API (W3C File API Recommendation 2022) provides the FileReader and URL.createObjectURL entry points for reading user-selected files without a server round-trip; the uploaded image is loaded into an HTMLImageElement via a blob URL. The Canvas 2D API (HTML Living Standard) handles the raster drawing via drawImage and the pixel read via getImageData. These two APIs together let the whole pipeline run locally: decode the file, draw to a canvas, read the pixel buffer, format the color. No MIME-type upload to an image-processing service, no server-side thumbnailing, no third-party dependency. The Clipboard API (W3C Clipboard API Level 2) handles the copy-to-clipboard action via navigator.clipboard.writeText, which is the modern async permission-gated replacement for the deprecated document.execCommand("copy").
Comparison to Desktop and Browser Eyedroppers
macOS\'s Digital Color Meter and Windows\' PowerToys Color Picker sample any pixel on screen (not just inside a web page), which is more powerful for reverse-engineering desktop apps or comparing colors across multiple windows. Chrome has shipped a native EyeDropper API since version 95 - sites can call new EyeDropper().open() to let the user pick any pixel on the page, which is faster than this tool when the source image is already visible in the browser. Figma and Sketch have built-in eyedroppers that sample inside the document. This tool\'s niche is the upload-an-image path: you have a PNG or JPEG on disk, you want to extract colors from it without installing anything, and you want the HEX, RGB, and HSL representations in one view. Chrome\'s native EyeDropper will eventually supplant some of this, but for non-Chromium browsers and for the explicit upload-and-sample workflow, the canvas-based approach remains the cleanest.
Frequently Asked Questions
How accurate are the sampled colors?
Byte-accurate to the decoded pixel. The tool uses <code>getImageData</code>, which reads directly from the canvas pixel buffer in sRGB byte order - what you see is what the file stores (after the browser's image decoder ran). The only accuracy losses come from the file format itself: JPEG quantization can shift individual pixels by a few units, and images tagged with non-sRGB color profiles are read as raw sRGB bytes without profile conversion.
Why does my JPEG give slightly different values at adjacent pixels?
Because JPEG compression works on 8x8 blocks and quantizes color information aggressively in the Cb/Cr chroma channels. Adjacent pixels in a JPEG often share identical luma but differ in chroma by small amounts, which appears as slight RGB variation. For critical color work, use a PNG or WebP source (both are lossless or near-lossless), or sample a small neighborhood and average the results.
Can the tool read colors from a PDF or SVG?
SVG yes via rasterization (right-click and "Save image as" a PNG first), PDF no. For PDFs, open in a PDF reader, take a screenshot, and upload the screenshot. Direct SVG support would require parsing the DOM and traversing fill colors - outside this tool's canvas pipeline.
What is the HSL output based on?
The same CSS Color Module Level 4 HSL formula every browser uses for its <code>hsl()</code> parser: lightness is the mean of the max and min RGB channels, saturation is chroma divided by one minus the absolute lightness offset from 0.5, and hue is the angle on the RGB cylinder. HSL is convenient for tweaking - you can shift hue without changing brightness - but remember it is not perceptually uniform; two HSL colors with the same lightness can look very different in actual brightness.
Will my image be uploaded to a server?
No. The file is read via the browser's File API into a blob URL that is scoped to the current tab, drawn into an off-screen canvas, and pixel-sampled locally. No fetch request carries your image, no analytics event includes the file, and the blob URL is revoked when you navigate away. You can disconnect your network after the page has loaded and the tool still works.
How many colors can I save to history?
The history panel holds 20 entries. Clicking past 20 drops the oldest entries first, FIFO. This is a sensible cap because the panel would become hard to scan much beyond that, and because most palette-building workflows need five to ten colors, not fifty. If you need to persist more, copy each HEX value into an external document as you sample.
Does it work on mobile?
Yes. The drop-to-upload becomes a tap-to-pick-file flow on touch devices, and hovering is replaced by tap-and-drag: touch the image, slide to the spot you want, and release to sample. iOS Safari, Android Chrome, and the mobile Firefox all expose the File API and Canvas 2D API used here. The main mobile caveat is zoom - pinch-to-zoom the image for precise sampling of small details.
Why does a color with transparency sometimes look different after sampling?
Because the tool reports the stored RGB bytes regardless of the alpha channel. A semi-transparent pink pixel on a transparent background has RGB (255, 192, 203) plus alpha 0.5, and the tool reports the RGB as if it were opaque. If you want the composed color as it renders against a specific background, draw the image onto a colored canvas first and then sample.
Is this the same as the native EyeDropper API?
Similar but different scope. The W3C EyeDropper API (shipped in Chrome 95, 2021) lets a page sample any pixel currently visible inside the browser window, which is great for picking colors from a rendered page but useless if the color you want is in a file on your disk that is not open on screen. This tool targets the upload-and-pick workflow specifically and works in every browser regardless of EyeDropper support.
Can I use this for print color matching?
Partially. The tool gives you accurate sRGB values, which you can convert to CMYK in the companion color converter. For production-quality print matching you still need an ICC profile for your target printing press and a calibrated monitor - the color converter's CMYK output is a screen approximation, not a press-ready separation. Use this tool to identify the target color, then feed the result into Photoshop or InDesign with your print profile for the real conversion.
More Image Tools
Base64 to Image Converter
Decode a Base64 string or data URL back into a viewable image and download it as PNG, JPG, WebP or GIF. Runs in your browser.
Open toolFavicon Generator
Generate favicons in all standard sizes (16x16 to 512x512) for websites and PWAs.
Open toolImage Blur & Pixelate
Apply blur or pixelation effects to images with adjustable intensity.
Open toolImage Compressor
Compress images by adjusting quality to reduce file size without losing visual clarity.
Open toolImage Cropper
Crop images with preset aspect ratios like 1:1, 16:9, and 4:3 using a visual editor.
Open toolImage Flip & Rotate
Flip images horizontally or vertically and rotate by 90, 180, or 270 degrees.
Open tool