Skip to content
Technical guide12 min read

Wavelength and color in machine vision lighting: white, red, blue, green, IR and UV

A practical engineering guide to choosing LED wavelength in machine vision lighting. Learn how monochromatic red, blue, green, IR and UV light change contrast, how to exploit complementary colors, and how to match wavelength to your camera, lens and optical filters.

Why wavelength is a contrast tool, not just brightness

Most lighting discussions start with geometry - bright field, dark field, dome, backlight - and that is the right first decision. But geometry only controls where light comes from. Wavelength controls what the surface does with that light once it arrives. Two parts under identical geometry can produce completely different images depending only on the color of the LEDs, because every material reflects, absorbs, transmits and scatters each wavelength differently. Treating wavelength as a deliberate engineering variable, rather than defaulting to white, is one of the cheapest ways to turn a marginal inspection into a robust one.

The core physical idea is selective reflectance. A surface appears a particular color because it reflects some wavelengths strongly and absorbs others. A red label reflects long (red) wavelengths and absorbs short (blue) ones; that is precisely why it looks red. In machine vision we exploit this to create or destroy contrast on demand. If a feature and its background reflect white light almost identically - a common cause of failed inspections - they will often reflect at least one narrow band very differently. Finding and illuminating with that band is the whole game.

White light is the sum of all visible wavelengths, so it tends to average out these differences. It is forgiving and convenient, and it is the correct choice when you genuinely need true color information or when you have not yet characterized the part. But averaging is exactly the wrong behavior when your goal is to separate two materials that happen to have similar overall lightness. Monochromatic light, by contrast, lets one specific difference dominate the image. The practical workflow is to identify the contrast you need (defect vs good surface, print vs substrate, fill level vs container) and then choose the wavelength that maximizes that specific difference.

Monochromatic vs white light: the fundamental choice

The first wavelength decision is whether to go monochromatic at all. Monochromatic light - a single dominant wavelength from red, blue, green, IR or UV LEDs - buys you three things that white light cannot: targeted contrast via complementary colors, reduced chromatic aberration in the lens, and the ability to reject ambient light with a matched bandpass filter. Those three benefits are why a large share of demanding inspection systems run monochromatic light onto a monochrome camera.

Chromatic aberration is an underappreciated reason to go monochromatic. A simple lens focuses different wavelengths at slightly different planes, so broadband white light spreads a point of detail into a soft, color-fringed blur. Single-wavelength illumination removes that spread, letting an ordinary lens deliver noticeably sharper edges - effectively a free resolution gain. This matters most at high magnification and with lower-cost lenses, and it pairs naturally with the resolution and field-of-view trade-offs you size up when choosing a lens. (Well-corrected apochromatic lenses reduce the effect across colors, but monochromatic light sidesteps it for any lens.)

White light keeps its place for a defined set of jobs. Choose it when the application requires faithful color rendering (sorting by color, verifying correct colored components, grading produce), when you are illuminating for a human operator as well as a camera, or when the inspection genuinely depends on multiple color differences at once that a single band cannot capture. White is also the safe starting point during feasibility trials before you have measured which monochromatic band gives the best separation. The trade-off is that white forfeits filter-based ambient rejection and reintroduces chromatic aberration.

  • Choose monochromatic when: you need maximum feature contrast, ambient-light immunity via a bandpass filter, the sharpest possible edges, or you are inspecting a single well-characterized material difference.
  • Choose white when: you need true color information, the system also serves a human operator, the inspection relies on several color cues simultaneously, or you are still in early feasibility and haven't characterized the part.
  • Monochromatic light belongs on a monochrome camera; white light is the natural partner for a color camera.
  • Remember that 'monochromatic' LEDs are not laser-pure: they have a finite spectral width (typically tens of nanometers), wide enough to use efficiently but narrow enough for strong contrast control and filtering.

Using the color wheel: complementary contrast

The single most useful mental model for color selection is the color wheel. The rule is simple and reliable: a surface illuminated by light of its own color appears bright, and the same surface illuminated by its complementary (opposite) color appears dark. The complementary pairs are red with cyan, green with magenta, and blue with yellow. So a red feature lights up under red illumination and goes nearly black under cyan or blue, while a blue feature does the reverse. An orange or amber surface sits between red and yellow, so it is darkened most effectively by blue.

This gives you two complementary strategies for any two-tone problem. To make a feature stand out bright against a darker background, illuminate with the feature's own color. To make a feature stand out dark against a brighter background, illuminate with its complementary color. A classic example is a date code or scratch on an orange or amber surface: blue light drives the orange substrate dark while a contrasting mark or defect reflects differently, producing strong contrast that white light would wash out. Conversely, reading dark print on a colored carton often works best when you illuminate with the carton's own color to brighten the background and silhouette the print.

Green deserves a specific mention because it sits in the middle of the visible spectrum and near the peak responsivity of many monochrome silicon sensors and the human eye. Its complementary color is magenta, so green light darkens magenta and pink tones while brightening green ones. Green is a strong general-purpose monochromatic choice for many biological and food surfaces and as a balanced compromise when you need good resolution without going all the way to blue. When two candidate parts or defects don't have an obvious color, the practical method is empirical: image the part under red, green and blue and pick whichever band gives the cleanest grayscale separation between the feature and its background.

  • Feature bright on dark background: illuminate with the feature's own color.
  • Feature dark on bright background: illuminate with its complementary color.
  • Complementary pairs: red-cyan, green-magenta, blue-yellow; blue light darkens orange/amber/yellow surfaces, red light darkens cyan/green/blue surfaces.
  • When in doubt, test red/green/blue on the actual part and measure grayscale separation - let the histogram decide, not intuition.

Blue and UV: fine detail, surface texture and fluorescence

Shorter wavelengths carry an inherent resolution advantage. The diffraction limit - the smallest feature an optical system can resolve - is proportional to wavelength, so blue light (commonly around 450-470 nm) can resolve finer detail than red or IR for the same optics and aperture. Blue also tends to scatter more at rough surfaces and emphasize fine texture, scratches, machining marks and small geometric defects that longer wavelengths smooth over. For high-precision dimensional gauging, fine-pitch features and small surface defects, blue is frequently the highest-performing visible choice, which is why it shows up so often in high-resolution inspection setups. The gain is incremental, not dramatic, because the lens aperture (its numerical aperture) usually dominates resolution more than the wavelength does.

Ultraviolet (typically UV-A, around 365-405 nm) extends the resolution and surface-emphasis benefits and adds effects that simply don't exist at longer wavelengths. UV is strongly absorbed and scattered at the very top surface, so it excels at exposing extremely shallow surface features, fine scratches, and coating or adhesive coverage that visible light passes straight through. It is also a standard tool for revealing materials that look identical in visible light but differ in how they handle UV - for example confirming the presence of a UV-absorbing coating or sealant.

The most powerful UV technique is induced fluorescence. Many materials - certain adhesives, oils, inks, biological residues, security markings and optical brighteners - absorb UV and re-emit at a longer visible wavelength, so they glow under UV excitation. The inspection trick is to flood the part with UV, then fit a filter on the camera that blocks the reflected UV and passes only the emitted visible glow. The result is a high-contrast image where only the fluorescing material is bright. This demands care across the whole imaging chain: the sensor must be sensitive at the emission wavelength, ordinary glass lenses absorb shorter UV (so UV-capable optics may be needed for the excitation source, though the camera typically images the visible emission), and operator safety and enclosure design matter because UV is invisible and can be harmful to eyes and skin. Blue and UV LEDs also tend to be less efficient and run hotter than red, so thermal management and a good lighting controller for stable, often strobed, output become more important.

Infrared: penetrating, ignoring print and reducing variation

Infrared (commonly near-IR around 850-940 nm) does almost the opposite of UV. Long wavelengths scatter less, penetrate further into many materials, and are reflected or absorbed in ways that frequently ignore visible color entirely. The headline benefit is that IR tends to 'see through' or wash out printed graphics and colored inks while still imaging the underlying structure, because many dyes that are opaque in the visible become transparent in the near-IR. If you need to inspect a feature beneath busy multicolor printing - a fill level behind a printed label, a seam, an embossed mark, the presence of a component under packaging - IR can render the distracting print nearly invisible and leave only the structural feature you care about.

IR also reduces nuisance variation. Because it largely ignores visible color, a line running mixed product variants with different printed artwork can often be inspected with one consistent IR image instead of a color-dependent setup per variant. IR penetrates some thin plastics and organic layers, which helps with fill-level checks through translucent containers and with reading marks under semi-transparent coverings. The flip side is that contrast which depends purely on color will vanish in IR, so it is the wrong tool when the distinction you need is itself a color difference.

Working in the near-IR has real constraints. Standard silicon sensors retain useful sensitivity out to roughly 1000 nm but are progressively less responsive toward the long end, so exposures or light levels often need to rise. Many cameras and lenses ship with an IR-cut filter that must be removed for IR work, and a lens that is sharp in the visible can shift focus or soften in the IR unless it is rated for near-IR use. Wavelengths beyond about 1000 nm (SWIR and thermal) leave silicon entirely and require specialized InGaAs or microbolometer sensors and dedicated optics - a different class of system, not a simple LED swap.

Pairing wavelength with the camera, filter and ambient strategy

Wavelength choice and sensor choice are one decision, not two. A monochrome sensor records every photon as intensity regardless of color, so it captures the full benefit of monochromatic illumination at full spatial resolution. A color sensor places a Bayer mosaic of red, green and blue filters over the pixels, then interpolates the missing colors. That demosaicing gives up part of the sensor's effective resolution - the exact penalty depends on the metric and the scene, but luminance detail is noticeably softer than a same-pixel mono sensor - and each pixel only sees light in its own color band, so narrow-band illumination is wasted on two-thirds of the pixels. For single-wavelength inspection, mono almost always wins on resolution, sensitivity and predictability.

The matched bandpass filter is what turns monochromatic light into ambient-light immunity. Fit a filter on the lens whose passband matches your LED wavelength - a red bandpass with a red light, for instance - and the sensor accepts your controlled illumination while rejecting most of the broadband ambient (room lights, sunlight, other machines). For UV-induced fluorescence the logic inverts: you block the excitation UV and pass only the longer-wavelength emission. Either way, the filter and the light source are specified together, and the filter's passband must sit inside the sensor's region of sensitivity.

For the most robust setups, combine three defenses so the image becomes essentially independent of the surrounding environment: physically shroud or enclose the station so external light cannot reach the part; fit the matched bandpass filter; and drive the LEDs in strobe with a short exposure so the controlled flash overwhelms any continuous ambient contribution. Strobing also lets a good lighting controller overdrive the LEDs briefly for extra brightness, which is especially valuable with the less efficient blue and UV sources.

  • Monochromatic light belongs on a monochrome sensor; reserve color sensors for jobs that genuinely need color information.
  • Specify the bandpass filter and the LED wavelength together, and confirm the passband falls within the sensor's sensitivity.
  • Lock down ambient light with three layers: enclosure, matched bandpass filter, and strobe plus short exposure.
  • Check sensor sensitivity, lens transmission and any IR-cut/UV-block filters before committing to a wavelength at the edges of the visible band.

A practical wavelength selection workflow

Start from the contrast you need, not from a favorite color. Write down the specific distinction the inspection must make - defect versus good surface, print versus substrate, fill level versus empty, glue present versus missing - and treat that as the target the wavelength has to maximize. Decide first on geometry (where the light comes from), then layer wavelength on top as the contrast-tuning variable.

Then test empirically on real samples. Image the part under red, green and blue, and add IR and UV if the application hints at penetration or fluorescence, and compare the grayscale separation between feature and background in each case. The histogram, not intuition, should choose the winner: pick the band that gives the widest, most stable gap between the two populations across the variation you expect (different units, operators, ambient conditions). Use the color wheel to predict good first candidates, but always confirm on parts.

Finally, validate the whole chain at the chosen wavelength before committing hardware. Confirm the sensor is sensitive there, the lens transmits and stays in focus, the bandpass filter matches, and the controller can deliver stable - ideally strobed - output with adequate thermal headroom. A wavelength that gives beautiful contrast on the bench but starves the sensor of light, or that needs optics you do not have, is not yet a solution. Get these pieces to agree and a difficult inspection often becomes routine.

  • Define the exact contrast the inspection needs, then choose geometry, then tune wavelength.
  • Image real samples under red/green/blue (plus IR/UV when relevant) and let grayscale separation decide.
  • Validate sensor sensitivity, lens transmission and focus, filter match, and controller capability at the final wavelength before buying hardware.

Frequently asked questions

Related categories

  • Machine vision lighting
  • Lighting controllers
  • Backlights

Related guides

Request a technical quote

If you have a specific application, we help you select the right hardware and validate it.