How to Pick a Color from an Image
Pick an exact color from any photo, logo, or screenshot in four steps. Use the magnifier loupe, build swatches, and export CSS — no install, no upload.
Pick any color from any image with an eyedropper. Learn HEX, RGB, HSL and CMYK codes, the magnifier loupe, swatches, and CSS export — free, in your browser.
CompressMyPic Editorial Team · Published Nov 17, 2026 · 11 min read

Every designer has seen a color on screen and wanted its exact code. A screenshot, a photo, a logo, or a website mockup can hold the perfect shade, but guessing its value never works.
An image color picker solves that problem in seconds. You open an image, point at any pixel, and read its exact color code in HEX, RGB, HSL, and CMYK.
This guide explains how the CompressMyPic image color picker works, what each color code means, and how to use picked colors in real design and development work.
An image color picker is a browser tool that reads the color of any pixel inside an image you upload. It works like the eyedropper tool in a design program, but without installing anything.
You drop a photo or screenshot into the tool, move your cursor over the image, and the tool shows the color under that exact point. The value updates live as you move.
The tool accepts common image formats such as JPG, PNG, WebP, and GIF. Files up to 20 MB are supported, which covers almost every photo, logo, and screenshot you will ever need to sample.
Everything runs locally in your browser. Your image is never uploaded to a server, so client mockups and unreleased brand work stay private while you sample them.
Every digital image is a grid of tiny squares called pixels. Each pixel stores one color, described by three numbers for red, green, and blue light.
When you click a point on the image, the tool reads the red, green, and blue values of that single pixel. It then converts those three numbers into every color format you might need.
The reading is exact, not an estimate. The pixel really is that color, and the code you copy will reproduce it faithfully in a design file, a stylesheet, or a print document.
One pixel can still surprise you, though. In a photo, neighboring pixels often differ slightly, so moving one step sideways can change the last digit of a HEX code.
Every picked pixel produces several color codes at once. HEX is the six-digit code web developers use in CSS, such as #2563EB for a strong blue.
RGB describes the same color as three numbers from 0 to 255, one each for red, green, and blue. It is the format most design tools and image editors understand natively.
HSL describes color by hue, saturation, and lightness. Designers like it because it matches how people think about color: pick a hue, then make it richer or lighter.
CMYK describes the color as ink percentages for print. It is an approximation on screen, since screens use light and printers use ink, but it is a useful starting point for print work.
Picking the right pixel is hard at normal zoom. A thin line, a small icon, or a one-pixel border is easy to miss by a hair, and a miss gives you the wrong color.
The tool solves this with an 11 by 11 magnified loupe. It shows a zoomed view of the pixels around your cursor, so you can see exactly which pixel you are about to sample.
The loupe is especially useful for UI screenshots. Buttons, dividers, and text often sit on anti-aliased edges where the color blends across two or three pixels.
With magnification you can aim for the solid center of a shape instead of its blended edge. That single choice is often the difference between the true brand color and a muddy in-between shade.
One color is rarely enough. A brand palette, a website theme, or a slide deck needs several colors that work together, and the tool lets you collect them one by one.
Each click adds the sampled color to your Picked Swatches tray. You can gather the main color, the accent, the background, and the text color from the same image.
Swatches stay visible while you work, so you can compare them side by side. If two picks look almost identical, you can drop one and keep the cleaner version.
Clicking the same HEX value twice does not create a duplicate. The tool keeps your collection tidy, which matters when you are sampling a photo with many near-identical shades.
Collected swatches are only useful if you can take them into your project. The Export CSS button downloads your picked colors as ready-to-use CSS custom properties.
The download gives you variables such as --color-1, --color-2, and so on, each holding a HEX value. You can paste them into a stylesheet and reference them anywhere in your design.
This beats copying codes one at a time into a text file. The export keeps every color in one place, in the right order, with no transcription errors.
For a fuller palette workflow, the image color palette extractor builds a ranked palette automatically. Use the picker when you want exact pixels and the extractor when you want the dominant colors of a whole photo.
Photos are the most common source for picked colors. A sunset, a product shot, or a travel photo can supply a whole palette that already feels natural together.
Start with the largest flat areas of the photo. A clear sky, a painted wall, or a piece of clothing gives a stable color that survives sampling better than a busy texture.
Avoid the brightest highlights and the deepest shadows. Those areas are often clipped, which means the true color information is lost and the code you get is just white or black.
Sample the same area a few times and compare the results. If the codes cluster around one value, that value is the real color of the surface. If they scatter, pick the middle of the cluster.
Logos and interface screenshots are the precision case. A brand color must match exactly, because a close shade looks wrong next to the real logo.
For logos, sample the middle of a large flat shape. The center of a letter or a block is solid, while the edges blend into the background and give mixed values.
For screenshots, paste directly with Ctrl+V when you can. The tool accepts clipboard images, so you can capture a screen and sample it without saving a file first.
When sampling a screenshot, check the pixel coordinates shown in the Pixel Inspector. Coordinates help you return to the exact same spot if you need to verify a value later.
JPEG compression changes pixel colors slightly. The format stores colors in small blocks, so two neighboring pixels in a smooth sky can differ by a digit or two.
This variation is normal and harmless for most work. Pick the value that appears most often in the area, and your result will look right to the eye.
PNG files behave differently. A PNG stores exact colors, so the code you read is the code the file contains, with no compression noise at all.
Transparent areas need care. Sampling a transparent part of a PNG logo reads the color underneath the transparency, which may be white or black rather than the color you expect.
The color picker works on phones and tablets as well as on desktop. You tap the image instead of clicking, and the same loupe and swatch features apply.
Touch is less precise than a mouse, because a fingertip covers many pixels at once. The magnified loupe matters even more here, since it shows what lies under your finger.
Zoom the image in your browser before tapping if the target is small. A larger image gives your finger a bigger target and reduces the chance of sampling a neighboring pixel.
For critical brand colors, verify the pick on a desktop later. A phone tap gets you close, but a mouse click on the exact pixel is the reliable final check.
The most common mistake is sampling an edge instead of a flat area. Anti-aliased edges blend two colors, and the blended value belongs to neither of them.
Another mistake is trusting a single click on a noisy photo. One pixel in a grainy image can be an outlier, so always sample the same spot two or three times.
People also forget that screens differ. The same HEX code can look slightly different on two monitors, so judge a color by its code, not only by how it looks on your display.
Finally, do not sample from a screenshot of a screenshot. Each capture and re-save can shift colors slightly, so always work from the cleanest original file you have.
The color picker and the palette extractor answer different questions. The picker tells you the exact color of one pixel you choose, while the extractor finds the dominant colors of the whole image.
Use the picker when you know what you want: the exact blue of a logo, the exact shade of a button, or the exact tone of a wall in a photo.
Use the extractor when you want ideas: the five or six colors that define a photo, ranked by how much of the image they cover. It is the faster route to a full palette.
Many designers use both. They extract a palette for the overall scheme, then use the picker to grab one precise accent color the extractor ranked too low to include.
Web developers use it to match a design mockup exactly. When a client sends a screenshot instead of a design file, the picker recovers the real HEX codes.
Graphic designers use it to build palettes from reference photos. A mood board photo can supply the entire color scheme for a poster or a brand identity.
Print designers use the CMYK readout as a starting point. It is not a perfect print match, but it tells them whether a bright screen color will survive on paper.
Content creators use it for thumbnails and social graphics. Matching a thumbnail accent to a brand color keeps a channel looking consistent across dozens of videos.
Privacy matters when the image is a client mockup, an unreleased product shot, or a personal photo. Uploading such files to a random server is a risk you do not need to take.
This tool processes everything locally. The image is read by your browser, the pixels are sampled on your device, and nothing leaves your computer.
That also means the tool works offline once the page has loaded. You can sample colors on a plane, in a meeting room, or anywhere without a connection.
If you handle sensitive brand assets, local processing is the deciding feature. No upload means no copy of the file sitting on a server you do not control.
Gradients are a special case, because the color changes smoothly from one end to the other. There is no single correct color in a gradient, only the color at the exact point you sample.
To capture a gradient, sample several points along its length. Pick the start color, the middle color, and the end color, and you can rebuild the gradient in CSS with those three stops.
Patterns need the same care. A striped or checkered surface contains at least two colors, and the picker reads only the pixel under your cursor, not the pattern as a whole.
For a pattern, sample each distinct band separately and save them all as swatches. The set of swatches then describes the pattern, even though no single click could.
Textured surfaces such as wood, fabric, or stone are the hardest case of all. Their color varies from pixel to pixel, so a single reading is almost meaningless.
With textures, sample five or six nearby pixels and look for the average. The most common value in the cluster is the best single representative of that surface, and it will look right in your design.
Open the image color picker in your browser. Drag your image into the upload area, or paste a screenshot straight from the clipboard.
A default color appears as soon as the image loads, sampled from the center of the picture. Move your cursor to explore, and watch the loupe zoom into the pixels under your pointer.
Click any pixel to add it to your Picked Swatches. Keep clicking to collect the full set of colors you need for your design.
When your collection is complete, click Export CSS to download the colors as stylesheet variables. Then read the step-by-step version in How to Pick a Color from an Image, or learn the code formats in HEX vs RGB vs HSL: Colour Codes Explained.
Pick an exact color from any photo, logo, or screenshot in four steps. Use the magnifier loupe, build swatches, and export CSS — no install, no upload.
HEX, RGB, HSL, and CMYK describe the same color in different ways. Learn what each format means, when to use it, and how to convert between them.
Turn photos into design palettes that actually work: the 60-30-10 rule, dominant vs accent, contrast, brand use, and the mistakes that make palettes muddy.
Extract a colour palette from any photo in five steps: upload, pick 3–12 swatches, read the percentages, and copy CSS or JSON — free, in your browser.