LightingExplainer

Light color and monochrome camera contrast: bright vs dark

How light color sets monochrome camera contrast: the reflect-or-absorb rule, a color wheel table, IR to fade print, and a worked exposure example at 300 mm/s.

LumaSpec Vision11 min read Share on LinkedIn

On this page 10 sections
  1. 01The rule: light the color it reflects, starve the color it absorbs
  2. 02The color wheel does the deciding
  3. 03Why colored light beats a filter and a threshold
  4. 04Worked example: a black date code on a four-color carton web at 300 mm/s
  5. 05Where colored light pays off
  6. 06Infrared: erase the print, keep the code
  7. 07When the color rule will not help
  8. 08Checks before you order
  9. 09Parts for each decision
  10. 10Questions

A monochrome camera reports one number per pixel: how much light came back. It cannot see color, which is why the color of your light is the strongest contrast tool on the bench. Light a part with a wavelength its surface reflects and the part fills the histogram from the top; light it with a wavelength it absorbs and it drops to black level. Below is the rule, the color-wheel table that turns it into a wavelength decision, the infrared trick that fades colored print so a black date code stands alone, and a worked exposure calculation for a moving carton web. It is for anyone pointing a monochrome camera at colored parts, printed packaging or parts sitting in a colored tray.

The rule: light the color it reflects, starve the color it absorbs

A surface looks red because its pigment scatters red back to the lens and absorbs green and blue. Drive those absorbed bands at it and nothing returns: a red part under a blue LED sits at black level no matter how bright the lamp is. Drive the reflected band at 620 nm and the same part returns nearly everything the lamp sends, close to saturation. The camera never changes; the gray levels do.

Two surfaces sit outside this game. White reflects every wavelength you send and black absorbs nearly all of them, so neither offers a wavelength decision — you separate them from other objects by attacking those objects' absorbed bands. In between, gray level tracks reflectance at the lamp's wavelength, times the lamp output, times your exposure. Choosing the wavelength is choosing the gray levels before the image exists.

For a defect-by-defect walk through the same idea, see which LED colour gives the best contrast in machine vision.

The color wheel does the deciding

White light is red, green and blue together; yellow is red plus green; magenta is red plus blue; cyan is green plus blue. A part reflects exactly the components it contains and absorbs the rest. So yellow goes bright under red, bright under green and black under blue. Magenta keeps red and blue bright and dies under green. Laid out as a table, the lamp choice becomes a lookup:

Part color Red light (~620 nm) Green light (~525 nm) Blue light (~470 nm) IR (850-940 nm)
Red bright dark dark reads like the base material
Green dark bright dark reads like the base material
Blue dark dark bright reads like the base material
Yellow bright bright dark reads like the base material
Magenta bright dark bright reads like the base material
Cyan dark bright bright reads like the base material
White bright bright bright bright
Black dark dark dark dark

Read the column of each candidate lamp: every element that must go dark should show dark in it, and the feature that must survive should show bright. When two colors must be told apart and they share a component, pick the band only one of them contains — the shared component stays bright in both and separates nothing. The wavelengths in the header are typical LED centers; the rule does not move by ten nanometers either way. Catalog ring lights and bar lights come in white, red, green, blue, UV and IR, with the IR variants offered at 850 nm and 940 nm.

Why colored light beats a filter and a threshold

The classic alternatives are white light with a bandpass filter on the lens, or white light plus software. A filter blocks every wavelength outside its band, so most of the lamp's output dies at the glass and the exposure stretches to compensate. The colored LED does the filtering at the source: every watt lands inside the band, the exposure stays short, and the histogram arrives as two clean populations — bright feature, dark background — that a plain threshold holds without heroics. The optical filter route earns its place when the part must fluoresce or the lamp color is fixed by another constraint.

What color cannot fix is direction. A specular surface that folds the lamp's own reflection straight into the lens saturates in any color — that is a geometry problem for dark field lighting or a crossed polarizer.

Worked example: a black date code on a four-color carton web at 300 mm/s

The case: an inkjet date code in black ink over a four-color process design, on carton moving at 300 mm/s, under a downward-looking monochrome camera. Two numbers settle the design.

Inputs (example values — substitute your own and rerun):

  • Field of view: 90 mm across the web, covering the code plus its position tolerance.
  • Sensor: 2448 pixels across, a typical 5 MP monochrome camera; this is the one input that changes with the camera.
  • Web speed: 300 mm/s, the line's rated speed.
  • Candidate lamps: white, red at 620 nm, IR at 850 nm.

Rule in words: readable print tolerates about one pixel of motion blur — the same budget as exposure time vs shutter speed for moving parts. Blur equals speed times exposure, so speed caps exposure at pixel size divided by speed, and pixel size is field of view divided by pixels across.

pixel size = FOV / pixels across max exposure = pixel size / web speed

Arithmetic:

  • 90 mm / 2448 px = 0.037 mm per pixel, which is 37 µm on the part.
  • 0.037 mm / 300 mm/s = 0.00012 s, so the exposure budget is 0.12 ms.

Wavelength decision, read off the table: black ink absorbs everywhere, so the code reads dark under all three candidates. Under white, the four-color background reflects its components and stays mid-gray, crowding the threshold. Under red at 620 nm, the panels without red go dark but the red panel stays bright beside the code. Under 850 nm IR the process inks stop selecting and the background reads like bare paper — bright, with the black code alone in the dark.

Result: a 0.12 ms exposure budget, and only the IR lamp separates the code cleanly.

Decision: run IR at 850 nm, strobed at or below 0.12 ms. The same budget sets the strobe mandate — at a continuous 1 ms exposure, one pixel of blur already appears at 0.037 mm / 1 ms = 37 mm/s, so at this pixel size any line faster than about 40 mm/s is a strobing line. If the 850 nm glow disturbs the floor, step to 940 nm and recover the lost sensor response with more drive current or overdrive strobing.

Where colored light pays off

  • Date and batch codes on colored packaging. The worked case above; IR over process ink, or a single color the background ink absorbs.
  • Part versus tray. Light the tray's absorbed band and the tray goes black while the part floats on it; flip the color to erase the part when the tray is the feature. Pick-and-place cells run on this.
  • Color verification on monochrome sensors. Wire color, cap liners, connector bodies: sequenced bands turn color into gray-level order, and the sorting method that survives ambient light holds it while room lighting wanders.
  • Two checks, one camera. Fire white for shape, then red or IR for the print — the multi-wavelength sequencing guide shows the frame pattern, and a light controller with one channel per color drives it.

Infrared: erase the print, keep the code

Past roughly 700 nm, most process-color inks, dyes and pigments stop selecting wavelengths. What returns to the camera is set by the substrate — paper, film, plastic — so a four-color panel reads like the unprinted sheet: bright. Carbon-black ink keeps absorbing across the near-IR, so the code stays black. The design fades, the code remains, and the threshold becomes trivial. That is the standard recipe for expiry codes on food packaging, and the same mechanism masks colored labels and much thermal-transfer print.

The IR bands offered across the ring and bar families are 850 nm and 940 nm, and the choice between them is a sensitivity trade. Silicon sensors return more signal per watt at 850 nm; 940 nm sits near the edge of silicon's response and costs exposure or drive, but it is fully invisible where 850 nm glows a faint dark red. Two side effects make IR more than a print eraser. Many thin films and uncolored plastics transmit it, so codes under a label or film become readable. And an IR lamp with a matching bandpass on the lens turns a bright plant into darkness for the camera — the formal version is the ambient light rejection specification. Treat the lamp like any bright source on the bench: the faint glow understates the output, so keep it out of direct eye line during testing.

When the color rule will not help

White and black parts sit outside the game: white returns every band and black absorbs every band, so no wavelength separates them from each other. Separate them by silhouette instead — lighting angles: surface or silhouette covers that switch. Bare metal is the second exception: a polished surface reflects by direction, not spectrum, so every color glares the same and the fix is geometry, as the shiny metal pins guide and the DPM lighting guide for marks on metal both show.

Two practical traps remain. If the ink or plastic color changes between production lots, the wavelength chosen against last month's sample can flip — spec the band against the ink and keep a sample of each lot on file. And a color camera splits bands per pixel through its Bayer mosaic, so the rule acts there too but diluted; the monochrome sensor is the clean instrument for it.

Checks before you order

  • Photograph the real part under white, red, green, blue and IR torches and compare the gray level of every element in frame, not only the target — the loser of a wavelength argument is usually a second feature you forgot was in the image.
  • If IR erase is the plan, confirm the code ink is black and shoot the exact label material before committing.
  • Recompute pixel size and exposure for your own camera and line speed; the budget decides continuous versus strobed drive.
  • Count every color as one controller channel and confirm the controller offers strobe before the schedule demands it — when the first frames come back black it is timing, and the strobe-on-black-image fix names the usual wiring and polarity causes.
  • Keep one channel spare; the second color you need is the one you did not plan for today.

Parts for each decision

  • A fixed station reading red parts: a 120 mm dia. ring light with a 60° angle at 620 nm:
Ring lights120 mm dia. ring light, 60°, 620 nm, 24 V (LS-RNG-0100)LS-RNG-0100
Size
100-200 mm
Type
Standard
Angle
60°
Voltage
24 V
$179.00View partBuild a system with it
  • A long web or wide field in red: a 423 x 40 mm diffused red bar light:
Bar lightsBar light, 423 x 40 mm, Red (LS-BAR-1168)LS-BAR-1168
Size
400 mm +
Type
Diffused
Voltage
24 V
$569.00View partBuild a system with it
  • One mounting point serving white and red frames: an arc head with a 1 W red and a 1.7 W white bank, 260 g on the bracket:
Ring lightsArc-shaped light, 1 W red / 1.7 W white, 260 g (LS-RNG-0877)LS-RNG-0877
Type
Arc / multi-angle
Voltage
24 V
$229.00View partBuild a system with it
  • The strobed, sequenced drive: a 4-channel, 200 W digital controller with RS232:
Light controllersDigital control box, 4 ch, 200 W, RS232 (LS-CTL-0070)LS-CTL-0070
Output
Constant voltage 24 V
Channels
4 channels
Control
Digital
Feature
Strobe
$549.00View partBuild a system with it

Pick the wavelength from sample photographs first; the electricals follow. Filter by color and wavelength in the light finder, match channels and strobe in the controller finder, or start from your camera in the lighting configurator. If a sample refuses to separate, send its images through the contact page and we will read the gray levels with you. The rest of the lighting library lives on the lighting topic page.

Questions

Why does my colored part turn black under a colored light?

The pigment absorbs that wavelength and returns nothing. A red part reflects around 620 nm and absorbs blue, so a blue LED leaves nothing to come back and the part sits at camera black level. The camera is not failing; it is reporting the reflectance. Switch to the band the part reflects, red light under the same red part, and the gray level swings from near zero to near saturation. That swing is the contrast.

850 nm or 940 nm infrared: which do I try first?

Start at 850 nm. Silicon sensors return more signal per watt there than at 940 nm, which sits near the edge of silicon's response, so your exposure stays shorter. Move to 940 nm when the faint red glow of 850 nm would disturb operators or the station must run unlit, and recover the lost signal with more drive, a wider aperture or overdrive strobing. Both wavelengths are standard options in the ring and bar light families.

Does the same wavelength rule apply to a color camera?

Partly. A Bayer color camera already splits red, green and blue onto separate pixels, so some of the separation happens in the sensor and the rule matters less. A narrowband light still shifts what every channel sees, but each channel receives only a share of the returned photons. On a monochrome sensor one channel collects all of them, which is why color-on-monochrome gives the stronger and more predictable effect.

Can one station check two features that want different light colors?

Yes, by sequencing. Put each color on its own controller channel and fire one per frame: white for shape and texture, then red or IR for the code, with the results registered in software. Heads that carry two LED banks in one body, like a red and white arc light, do this from a single mounting point. Budget one controller channel per color and keep the pulse timing identical from cycle to cycle.

Why does black print survive infrared while color print fades?

Black ink is usually carbon black, which absorbs across the visible and near-infrared. Most process-color inks carry pigments whose absorption bands sit inside the visible spectrum; past roughly 700 nm they reflect much like the paper or film beneath them. Infrared therefore lifts the background toward paper brightness while the code stays dark. A minority of inks absorb in the IR too, and anything black on the label stays black, so confirm on a production sample.