
Need to match a color in a photo for a website, illustration, presentation, or room concept? You can find RGB values from an image with a color picker or color extraction tool. The result gives you a numerical description of a sampled color that you can reuse in digital design.
The process is simple, but the number you get depends on where you sample and how the image was captured or edited. This guide explains how to pick a useful color, understand its RGB code, and work with the result—along with the limitations to keep in mind.
What are RGB values?
RGB stands for red, green, and blue, the three color channels used to describe colors on digital screens. Each channel is commonly represented by a number from 0 to 255. Combining different amounts of red, green, and blue produces a wide range of colors.
For example, rgb(58, 111, 143) means the color contains 58 units of red, 111 of green, and 143 of blue. The same color can be written as the HEX code #3A6F8F. RGB is handy when a design tool or code editor asks for channel values; HEX is a compact way to record the same color for many digital workflows.
| Format | Example | What it represents |
|---|---|---|
| RGB | rgb(58, 111, 143) | Red, green, and blue channel values |
| HEX | #3A6F8F | The same channel values in hexadecimal notation |
How to find RGB values from an image
You can use a desktop image editor, a browser-based color picker, or a mobile color extraction app. The exact controls vary, but the basic workflow is similar:
- Choose the image. Open the photo or artwork that contains the color you want to reference. Use the clearest available version, rather than a thumbnail or a screenshot of a screenshot.
- Open a color picker. Select an eyedropper or image-sampling tool. In a mobile app, this may mean importing a photo and tapping or moving a sampler over it.
- Pick a representative area. Aim for a part of the image with even color, away from edges, reflections, deep shadows, and highlights.
- Read the RGB result. The picker may show RGB directly, or show HEX alongside other formats. If RGB is available, record all three channel numbers in order: red, green, then blue.
- Copy or save the code. Paste the value into your design software, notes, style guide, or project brief. Keep a short label describing where it came from.
For a concrete example, imagine sampling a muted blue area in a photograph and getting #3A6F8F. Its channel values are 3A, 6F, and 8F in hexadecimal. Converted to decimal, those are 58, 111, and 143, so the RGB notation is rgb(58, 111, 143). If your tool displays the value as RGB 58, 111, 143, it is reporting the same color.
How to choose a good sample
A photo rarely contains one perfectly uniform color. A painted wall may look lighter near a window and darker in a corner; fabric can shift from one pixel to the next because of texture and folds. A single sample describes the spot you selected, not necessarily the whole object.
- For a flat graphic: sample well inside a solid shape, not on its antialiased border. Edge pixels often blend the shape with the background.
- For a material or surface: choose an area that reflects the overall appearance, avoiding a bright glare or a strong cast shadow.
- For a gradient: sample at a location that matches your intended use. There is no single RGB value for the entire gradient.
- For a palette: sample several distinct colors, then compare them together. A set of nearby shades can be more useful than many almost-identical picks.
If the sampler magnifies the image or lets you move a marker precisely, use that view to avoid neighboring colors. When the tool reports a palette rather than one value, treat it as a starting point: review the swatches and keep the colors that suit your project.
Why RGB values can differ between tools
Different RGB readings do not always mean that one picker is broken. A photo records light under particular conditions, and its appearance can be changed before you sample it. Consider these factors when a value seems unexpected:
- Lighting and white balance: warm indoor light, daylight, and camera adjustments can all affect how a surface is recorded.
- Editing and filters: exposure, saturation, contrast, and color grading alter the pixels in the image.
- Compression and resizing: image processing may change pixel values or blend nearby colors, especially around edges and fine details.
- Color profiles: images and software may use different color-management settings. A numerical sample is most useful when you know which image file and workflow it came from.
- Display settings: screen brightness, night modes, and display calibration affect how a color looks to your eyes, even when the stored code is unchanged.
For consistency, sample from the same source image and use the same tool where possible. Save the original image with the values, and note whether the image was edited. If your goal is to reproduce a color precisely across devices, check the color-management requirements of the tools involved instead of relying on how the color looks on one screen.
Using RGB values in design
Once you have a value, you can enter it into software that accepts RGB color input. In CSS, for example, you can define a text or background color like this:
.accent {
color: rgb(58, 111, 143);
}
Design applications may offer RGB fields, HEX fields, or both. If you only have HEX, many tools convert it to RGB automatically. The example above can also be written as #3A6F8F; confirm that the selected color space and any opacity setting match your intended use.
RGB sampling can support a range of creative projects:
- Graphic design: pick an accent from a reference image and use it in a digital layout, icon, or presentation.
- Web design: record colors from visual references and test them in interface elements. Check text/background contrast separately; a sampled color is not automatically accessible.
- Illustration: collect colors from a photo as visual references, then adjust them to fit the artwork’s lighting and style.
- Interior design concepts: build a digital mood board from a room or inspiration photo. A sampled screen color is a visual reference, not a guaranteed paint match.
RGB, HEX, HSL, and HSB: which value should you keep?
RGB and HEX describe a color using red, green, and blue channels. HSL describes hue, saturation, and lightness, while HSB uses hue, saturation, and brightness. These formats provide different ways to inspect or adjust a digital color. For example, HSL can make it easier to think about making a color lighter or less saturated, while RGB is useful when a workflow specifically requests channel values.
Conversions between formats are representations of the sampled color, not new measurements of the photographed object. Keep whichever formats your project needs, and label them clearly so a collaborator knows which code to enter.
Common mistakes to avoid
- Sampling a shadow and calling it the object’s color: decide whether you want the photographed shadow or a representative base tone.
- Assuming one pixel represents a whole surface: sample multiple points when the area varies, then compare the results.
- Mixing up channel order: RGB is red, green, blue. Keep the labels when copying values into a tool.
- Expecting screen values to guarantee print or paint results: physical materials and printing processes have their own color behavior. Use appropriate proofing or manufacturer guidance when physical reproduction matters.
- Forgetting the image source: store the image name or a short note with the code so you can revisit the same reference later.
Make image color sampling part of your workflow
To find RGB values from an image, open the image in a color picker, sample a deliberate area, and record the three channel values. Use the result as a digital reference, check it in the context of your design, and remember that lighting, editing, and color management can affect what you see or measure. For photo-based palettes on iPhone or iPad, Color Viewfinder’s guide to picking HEX colors from a photo explains a related sampling workflow; the app can also display RGB, HEX, HSL, and HSB values and export palette data.
