Colored parts waste contrast. Red print on a white housing, green solder mask over copper, a copper fitting beside steel — each pair collides at the gray level, and the reflex fix is a better camera or a longer exposure. The cheaper fix is the color wheel: light the part with the color opposite its surface, and the surface absorbs that light instead of returning it. This guide gives the pairings, the wavelengths, the contrast arithmetic that proves the choice, and the cases where color does nothing. For the wider background on light color and contrast, start with which LED colour gives the best contrast in machine vision; this page is the working wheel.
The rule: light the part with the opposite color
A pigment is defined by what it absorbs. Red surfaces absorb green, green surfaces absorb red, and warm metals — copper, brass, gold — absorb blue. So the rule is one sentence: to darken a surface, use the LED color opposite it on the wheel, and the same LED brightens everything that is not that color, because the neighboring features keep reflecting while the surface quits.
| Surface to darken | Dominant band | Suppressing LED | What you see |
|---|---|---|---|
| Red ink, red plastic, red anodize | 620-650 nm | Green, 520-530 nm | Surface falls close to black |
| Copper, brass, gold, orange | 580-610 nm | Blue, 460-470 nm | Warm metal darkens; steel and marks stay bright |
| Yellow print | 575-585 nm | Blue to violet, 440-470 nm | Yellow drops out |
| Green solder mask, green plastic | 520-550 nm | Red, 620-660 nm | Mask goes dark; copper and legend stay bright |
| Blue plastic, blue ink | 450-470 nm | Amber near 575 nm, via white LED plus pass filter | Blue darkens |
| White, black, grey, mirror metal | none | Any; geometry decides | Brightness changes, contrast does not |
Read the table as decisions. Red on white: green LED. Green board with copper: red LED — trace inspection under red light is a classic set-up for exactly this reason. Copper or brass against steel: blue LED. Blue part: amber light, and where amber emitters are not stocked, keep the white LED and filter the lens. Black-on-white and grey-on-grey: the wheel has nothing to suppress, so spend the effort on geometry instead.
The wheel also runs out at both ends. UV and near-IR have no complementary visible color; they are chosen for other effects entirely, covered in wavelength ranges of light in machine vision.
Why the opposite color goes dark
A monochrome sensor counts photons; it does not know their color. Gray level is proportional to how many photons the surface returns within the band the LED emits and the sensor answers. Swap a white LED for a green one on a red surface and two things happen at once: the red pigment absorbs nearly all of the green band, and no other band is present to reflect. The surface's gray level collapses, while a white or metallic feature beside it hardly moves.
What your threshold cares about is the ratio, and the standard measure is Weber contrast:
with G_bg and G_fg the mean gray levels of background and feature on a 0-255 scale. C = 0 is a flat image; C = 1 is a black feature on a bright background. Working numbers: C around 0.6 is the floor for a fixed global threshold under normal plant lighting, and C around 0.8 buys margin for dirt, LED aging and part color drift.
Notice what is missing from the formula: exposure and gain. Doubling exposure doubles both gray levels and leaves C untouched, which is why a camera upgrade rarely fixes a color problem. Light color and monochrome camera contrast makes the same point from the camera side.
Worked example: red print on a white housing
Task: a red ink date code on white ABS, monochrome camera, fixed gain. The counts below are illustrative — your part will read differently — but the method and the ratio transfer to any camera.
White LED, 2.0 ms exposure. Background G_bg = 232; the red print G_fg = 95, because red ink still returns the red part of the white LED's output.
C = (232 - 95) / 232 = 137 / 232 = 0.59
That is below the 0.6 floor: a marginal image that will misread on a dusty part.
Green LED, 520-530 nm, same gain and exposure. The red pigment absorbs the green band: G_fg = 15. The white plastic reflects it: G_bg = 205.
C = (205 - 15) / 205 = 190 / 205 = 0.93
Restore the background level by lengthening exposure: 2.0 ms × (232 / 205) = 2.26 ms, so set 2.3 ms. The print stays at the bottom of the scale, because its absorption is spectral, not proportional to intensity.
Decision: green LED, exposure 2.3 ms, threshold at the midpoint (205 + 15) / 2 = 110. The feature now sits 190 counts below the background instead of 137, and contrast moved from 0.59 to 0.93 — from marginal to margin.
White light plus a pass filter: the same trick with one part number
The suppression lives in the band that reaches the sensor, not in the LED's own phosphor. A white light plus a green band-pass filter on the lens darkens a red surface just like a green LED; you pay the filter's transmission loss as a slightly longer exposure. Take that route when one station inspects several part colors — swapping a screw-in filter per job beats stocking an emitter per color — and when you need a band the LED range does not cover, such as the amber that darkens blue. Filter choice has its own trade-offs, mapped in machine vision optical filters: choosing contrast over color.
Two diffused bars, the white-emitting and the red-emitting route:
| Specification | LS-BAR-1276 | LS-BAR-1168 |
|---|---|---|
| Color | White | Red |
| Power | 11.5 W | 26.9 W |
| LED rows | 4 | 6 |
| Cable length | 500 mm | 1 m |
| Dimension | 372 mm × 28 mm × 27 mm | 423 mm × 40 mm × 30 mm |
| Temperature | Working temperature: 0 °C to 40 °C (32 °F to 104 °F); Storage temperature: –20 °C to 60 °C (–4 °F to 140 °F) | Working temperature: 0 °C to 40 °C (32 °F to 104 °F); Storage temperature: –20 °C to 60 °C (–4 °F to 140 °F) |
| Humidity | 20% to 85% RH (non-condensing) | 20% RH to 90% RH (no condensation) |
| Diffuse plate included | Included | PMMA |
| Emitting area dimension | 360 mm × 22 mm | 411 mm × 31.6 mm |
| Price | $439.00 | $569.00 |
All 2 share: Connector type SMR-03V-B. Values as printed in each product's data sheet; open a part for its drawing and full specifications.
Keep the LS-BAR-1276, a diffused white bar at 372 × 28 mm, when part colors rotate and the filter does the color work. Keep the LS-BAR-1168, a diffused red bar at 423 × 40 mm, when every part is green and the color never changes.
Geometry sets the ceiling, color raises it
Color multiplies whatever contrast geometry creates; it cannot replace it. A flat part with the feature facing the camera wants even frontal light — ring lights at 30-60° or a bar pair. Curved, shiny surfaces want diffuse domes. Edges, silhouettes and diameters want backlight. Get that decision right first in machine vision illumination types: choosing the right geometry and machine vision lighting angles: surface or silhouette?, then apply the wheel on top.
The classic combined case is the green PCB. Geometry: a ring or bar pair grazing the board at a shallow angle. Color: red, which the green mask absorbs while copper, tin and silver keep reflecting, so traces and pads pop out of a near-black mask. The LS-RNG-0100 is a 120 mm ring light at 60° with a 620 nm emitter — deep red, the band that flattens a green mask; for full board width, a red bar lights pair does the same along the panel. Plastics follow the same logic defect by defect, and plastic part inspection lighting maps angle and wavelength per defect type.
- Size
- 100-200 mm
- Type
- Standard
- Angle
- 60°
- Voltage
- 24 V
One camera, two colors: sequence them
Some parts carry two colors that want opposite lights — a green board with a red legend, or one line running red and blue housings past the same lens. Do not average them out with white light; sequence them. Two lights on a multi-channel light controller with strobe output: the camera trigger fires color A for one frame, color B for the next, and software merges the pair. Each frame gets its full complementary suppression, and one camera does the work of two.
The frame logic is shown in multi-wavelength light sequencing; the strobe wiring runs over the camera's I/O line, and do I need a camera GPIO cable? settles that question. The LS-CTL-0070 is a 4-channel digital control box, 200 W, with strobe and RS232.
- Output
- Constant voltage 24 V
- Channels
- 4 channels
- Control
- Digital
- Feature
- Strobe
Once lights strobe in sequence, trigger and exposure drift become the next failure mode — stabilizing lighting changes on the machine vision trigger walks through locking that down.
Checks before you order
- Photograph the actual part under white light with everything else as it will run. Read the two mean gray levels and compute C; the ROI-and-reference method for measuring light intensity keeps those readings comparable over time.
- Apply the wheel pairing and re-shoot. The feature's counts should collapse; if they do not, the surface is not really that color — metallics fool the eye.
- Confirm the camera sees your band. Monochrome silicon answers everything from roughly 400 to 1000 nm, so red, green and blue all work; color (Bayer) cameras do not — see the FAQ.
- Plant light dilutes suppression, because ambient white refills the band your LED removed. Strobe the light and shorten exposure to drown it; the ambient light rejection specification quantifies the margin you need.
- Run the whole plan on saved images before buying: machine vision lens and lighting selection: a test plan is the template.
When the color wheel is the wrong tool
- Black on white, grey on grey. There is no color to suppress, so any LED gives the same contrast. Spend the money on geometry and a stable drive current instead.
- Mirror-finish metal. A mirror returns every wavelength, and the wheel cannot darken it. Use a diffuse dome, low angle, or polarization — lighting shiny metal pins without glare and cross polarization to reduce surface glare cover those routes. Warm metals that scatter some light still respond: copper surface inspection lighting pairs blue light with the right angle.
- Clear glass and plastic. These transmit rather than absorb, so wavelength does almost nothing. Backlight them — how to detect small transparent parts with machine vision shows the set-up.
- Parts whose color varies. Natural materials and mixed batches shift hue unit to unit, and a fixed complementary light over- or under-suppresses at random. Go to white light with a color camera and classify in software, as in classify irregular objects by appearance reliably.
Five-minute checklist
- Write down the surface you must darken and read its band from the table.
- Opposite LED: red surface gets green, orange and copper get blue, green gets red, blue gets amber via a filter on white light.
- Compute Weber contrast from two gray readings; ship at C of 0.8 or better, redesign below 0.6.
- Fix geometry first — flat parts get a ring or bar pair, curved shiny parts a dome, edges a backlight — then apply color.
- Two colors on one part: strobe-sequenced lights on a multi-channel controller, merged in software.
- Test the worst-case part variation, not the golden sample, before the purchase order.
Filter the lights finder to your color and size, or start at the light step of the system configurator to match light, camera and lens in one pass. An awkward part is quickest solved by sending a photo through the contact page. More lighting decisions are collected on the lighting topic page.
Questions
Does the color wheel trick work with a color camera?
Poorly. A Bayer color camera filters its pixels red, green and blue, so under a single green LED only the green half of the pixels collect light; the red and blue quarters sit near zero and the demosaiced image comes out mottled. Run single-color lighting on a monochrome camera, or pull only the matching color channel and accept reduced resolution. Keep the color camera for measuring color, not for maximizing contrast.
Which LED color suppresses a copper or brass surface?
Blue, 460-470 nm. Copper and brass return orange-red light near 580-610 nm and absorb blue, so under blue light the warm metal's gray level drops while steel, tin and silver stay bright — the standard pairing for separating copper features from steel or from solder mask. On polished copper add low-angle or diffuse geometry: a mirror returns every color, and blue alone will not remove the highlight.
Why not just increase exposure instead of changing LED color?
Exposure and gain multiply both gray levels by the same factor, so Weber contrast stays exactly where it was — and if the background clips at 255 you lose measurement information instead. Only a spectral change alters the ratio of what the two surfaces return, which is why the green LED in the worked example moves contrast from 0.59 to 0.93 while exposure alone cannot move it at all.
How much contrast does the right LED color add?
On strongly colored surfaces, a great deal: the worked example moves Weber contrast from 0.59 under white light to 0.93 under complementary green, at the cost of roughly a 13% longer exposure to restore the background level. On weakly tinted or metallic surfaces expect less, because the surface must genuinely absorb the complementary band. Measure C on the real part before and after; two gray readings take a minute and settle it.
What if the part color changes between units?
A fixed complementary light then over-suppresses some units and under-suppresses others, and your threshold chases the shift. Options in order of cost: widen the gray margin by fixing geometry first; sequence two LED colors and combine the frames; or move to white light with a color camera and let software classify — the usual route for natural materials like wood, food and stone, where hue variation is part of what you inspect.
Do infrared or UV LEDs follow the color wheel?
No — the wheel stops at roughly 400-780 nm. Near-IR at 850 or 940 nm is chosen because silicon sensors respond well there and ink, plastic and moisture scatter it differently, not because it complements any visible color. UV at 365-405 nm is chosen to make materials fluoresce or to resolve finer surface detail than visible light allows. Pick those bands by the effect you need, not by opposition on the wheel.

