Copying colors from compressed JPEGs: what to check
Learn why JPEG compression changes sampled colors, where to pick a pixel, and how display settings affect the HEX value you copy.
You sample a color from a JPEG, copy its HEX value, and find that it looks different from the color you saw in the picture. That can happen because JPEG compression changes pixel values, and display settings affect how the image looks on screen.
Before you use a sampled color in a design, check the file, the area you are sampling, and the way it is displayed. The Color Picker can sample a color from anywhere on your screen and show its HEX, RGB, HSL, and other values.
Check the JPEG before copying a color
- Open the Color Picker in Chrome or Edge on a computer. Color picking from anywhere on screen works in these browsers. Other browsers may offer a reduced version or no color picking.
- Open the original JPEG in a browser or image viewer. If you have the original file, use it instead of a copy saved from a messaging app or screenshot. A new copy may have been resized or compressed again.
- Show the image at its actual pixel size if you can. Avoid sampling while the image is enlarged, reduced, or displayed in a thumbnail. Resizing blends neighboring pixels and can change the color under your pointer.
- Choose a flat, even area of color. Stay away from text, sharp outlines, fine patterns, gradients, and shadows. These areas often contain pixels that are mixtures of nearby colors.
- Sample several nearby points inside the same flat area. Compare the HEX or RGB values. If the numbers are similar, you have a more dependable match than you would from a single pixel.
What the sampled colors mean
Nearby samples are almost the same
The area is relatively consistent, so a sample from its center is a reasonable choice for matching what you see in that JPEG. Keep the original image open while you use the value, and note that the value describes the displayed image, not necessarily the color the photographer or designer intended.
Nearby samples change noticeably
The image may contain texture, noise, shading, or compression artifacts. JPEG compression removes some image information to reduce file size, and the discarded details cannot be restored by sampling. Try another broad, even area. If every area varies, do not treat one pixel as an exact color specification.
The edge of an object looks muddy or has a faint outline
JPEG compression can make sharp color boundaries look soft or produce a light or dark halo. Those edge pixels mix the object with its surroundings, so their values are poor choices for copying the object's color. Sample well inside the object instead. For examples of this issue near text, see why color picker values vary around text edges.
The color looks different from what you expected
The JPEG may contain a color profile that affects how a color-managed browser displays it. Your screen profile and viewing settings also affect how the color looks to your eyes. A color value from the picker is useful for describing what you sampled, but it does not guarantee that the color will look identical on another display or in print.
How to get a closer match
- Use the original file. Look for the JPEG before it was resized, edited, or sent through a service that may compress images. Each new JPEG save can introduce more changes, so a later copy may not preserve the values in the original.
- Sample the middle of a solid area. Move away from outlines, letters, fine details, and strong shadows. Take a few samples close together, then use a value that represents the stable interior rather than an unusual pixel.
- Check display filters before judging by eye. On Windows 11, open Settings › System › Display and check whether Night light is on. On a Mac, open System Settings › Displays and check Night Shift and True Tone, if your display offers them. These features can change the appearance of colors, even when you have copied a numeric value correctly.
- Check the display color profile. On Windows 11, open Settings › System › Display › Color profile. On a Mac, open System Settings › Displays and review the selected color profile. Do not switch profiles at random. If you are matching colors for a specific workflow, use the profile recommended for that display or by your organization.
- Ask for a color specification when accuracy matters. If the JPEG is a logo, product image, or brand reference, ask for the approved HEX, RGB, or print color value. A compressed image can suggest a color, but it is not a reliable source for an exact brand or production color.
Why JPEG pixels vary
Unlike a lossless format, JPEG reduces file size by changing image information. It can soften small details and color boundaries, and may create block-like or ringing artifacts. The effect is easiest to notice in smooth areas, fine text, and vivid edges. Compression settings and repeated saves make a difference, so two JPEGs that started from the same picture may not give identical sampled values.
There is another difference between a file's stored pixels and the color you see. A browser can use an embedded color profile to render the image for your display. The Color Picker is useful for sampling what is on screen, but it cannot tell you what the image's color would look like on every other monitor or in a printed copy.
For a closer visual comparison, keep the image at its original size and sample from a large, evenly colored area rather than from an edge.
