You choose a lens by focal length, image circle and f-number, and a light by geometry and colour for contrast. One more variable decides how fine the detail can be: the wavelength of the light itself. Diffraction puts a hard ceiling on resolution, and that ceiling moves with wavelength at fixed aperture. Re-light the same monochrome camera from red to blue and the smallest resolvable feature shrinks by more than a quarter, with no change to the lens or sensor. This guide gives the two formulas, works the numbers at F2.8 on a real sensor pitch, shows where the gain survives contact with lenses and exposure budgets, and ends with the wavelength to pick for each inspection case.
Diffraction sets the ceiling, and wavelength moves it
A perfect lens still images a point as an Airy disk: a bright core with faint rings. Its diameter in the image plane follows two exact relations.
λ is the light's wavelength and N is the working f-number. Aberrations add blur on top of d, never subtract from it, so d is the floor under every lens's spot size; the diffraction limit and aperture effects guide covers the aperture side. Because d scales linearly with λ, the wavelength move is exact: at F2.8, blue light at 460 nm gives d = 2.44 × 0.46 µm × 2.8 = 3.1 µm, red at 630 nm gives 4.3 µm, and infrared at 850 nm gives 5.8 µm. Blue is (630 − 460) / 630 = 27% smaller than red, and since the cutoff frequency 1/(λN) inverts the ratio, blue carries detail about 1.37 times finer.
A worked example at F2.8
Take an illustrative setup: a 16 mm lens on a monochrome sensor with 3.45 µm pixels, wide open at F2.8, and the three colours from the section above.
- Blue: d = 3.14 µm ≈ 0.91 px
- Red: d = 4.30 µm ≈ 1.25 px
- Infrared: d = 5.81 µm ≈ 1.68 px
In blue the diffraction spot sits inside one pixel pitch, so the sensor samples the lens near its best case. At the red wavelength the spot already spans more than a pixel, and in the infrared a pixel and a half of softening rides on every edge before aberration or motion adds anything. One 16 mm C-mount lens rated 16-25 MP for 1.1" sensors spans F2.8-22, so the wide-open and stopped-down rows below live on one barrel:
- Type
- Machine vision fixed
- Sensor format
- 1.1"
- Mount
- C-mount
- Resolution
- 16-25 MP
The same lens at every aperture
Stopping down costs more resolution than any colour switch recovers: doubling the f-number doubles the spot, while red-to-blue cuts it by a quarter.
| Wavelength | F2.8 | F5.6 | F8 | F11 |
|---|---|---|---|---|
| 450 nm (blue) | 3.1 µm | 6.2 µm | 8.8 µm | 12.1 µm |
| 630 nm (red) | 4.3 µm | 8.6 µm | 12.3 µm | 16.9 µm |
| 850 nm (IR) | 5.8 µm | 11.6 µm | 16.6 µm | 22.8 µm |
Read the columns as the price of depth of field. At the red wavelength and F11 the spot is 16.9 µm — more than five times the blue F2.8 value, wide enough to blur away 8 µm surface texture. At close working distances, replace the barrel value with the working f-number N = N_nominal × (1 + m); at 1x magnification the true aperture is twice the marked one, as the working f-number and magnification guide derives.
Where short wavelengths earn their keep
Blue and violet pay off when the feature lives on the surface and is small: scratches, tool marks, laser-engraved codes, edges gauged to sub-pixel accuracy. Scatter from defects smaller than the wavelength strengthens steeply as wavelength falls — roughly with the inverse fourth power (Rayleigh scatter) — which is why fine surface defects that vanish under red light show under blue. Keep the aperture wide, because the diffraction gain only holds below the ceilings in the table above, and judge the lens itself with the lens contrast and resolution guide.
Long wavelengths earn their keep by erasing what you do not want. Thin oil films and oxide layers show interference fringes that mostly vanish under near-infrared light, along with fine wrinkles and machining texture, and infrared penetrates further into silicon and many plastics — the reason wafer and some plastics inspections run at near-infrared wavelengths up to 940 nm. The trade is that the infrared spot at F2.8 is about 1.9 times the blue one.
Contrast and resolution are separate choices: colour decides grey-level separation, the subject of the LED colour and contrast guide, while wavelength sets the detail ceiling on the spectrum mapped in machine vision light wavelength ranges.
When the job is measurement rather than detection, carry the same rule through the optics and rate the lens above the frequencies you need. Gauging-grade geometry usually goes one of two ways: a 60 mm, M58 FA lens for large-format sensors at WD 214-1536 mm, or a 0.4x fixed-magnification lens with 227 mm WD:
- Type
- Fixed focal length
- Sensor format
- Large format
- Sensor format
- 1.2"
- Mount
- C-mount
What short wavelengths cost
Silicon responds less as the wavelength drops: typical CMOS imagers give roughly 20-40% less signal in deep blue than in red. A red-to-blue switch therefore buys a longer exposure, a stronger LED, or one aperture stop of light, and the resolution gain survives only if signal stays above noise. On a moving line, motion blur spends the exposure budget faster than wavelength can repay it — recover light with aperture instead.
Below 400 nm the falloff steepens: sensor response and ordinary lens glass transmission both drop hard, so 365 nm light wants UV-rated optics and brighter LEDs even though it cuts the F2.8 spot to about 2.5 µm. Prove the whole chain on sample parts first, as the reflected UV surface inspection test guide sets out.
Match pixels to the spot, then pick the colour
The sensor stops rewarding shorter light once diffraction exceeds about two pixel pitches: λ × N ≤ 2p, with p the pixel pitch. On 3.45 µm pixels, 2p = 6.9 µm, giving the widest safe aperture per colour:
- Blue: N ≤ 6.9 / 0.46 = F15
- Red: N ≤ 6.9 / 0.63 = F10.9, about F11
- Infrared: N ≤ 6.9 / 0.85 = F8.1, about F8
A red-lit station runs out of diffraction headroom about half a stop before a blue-lit one. If the part is tall and the inspection needs F11 for depth of field, blue is the only colour of the three that still sits under the ceiling there. The zero-MTF logic behind the two-pitch rule is the Nyquist limit and camera resolution guide, and the pixel side of the same trade — how many pixels a defect needs — is what this calculator computes:
When the usual answer is wrong
Three cases flip the wavelength decision:
- Aberration-limited optics. The 27% promise holds only where the lens is diffraction-limited, typically at mid apertures on quality FA glass; wide open, aberration blur can exceed the Airy disk, so the colour move shifts a smaller share of total blur. Judge with measured MTF, not the formula alone.
- Tight exposure budget. Blue's lower sensor response shortens exposure; if the part moves, buy light with aperture or return to red and take resolution from a better lens instead.
- Surfaces that fight back. Shiny, layered or wrinkled parts throw fringes and texture under short-wavelength light that you cannot threshold away. Then the infrared colour — larger spot, calmer image — wins, helped by the geometry choices in the lighting geometry guide.
A fourth case simply steps around the question: on 9-10 µm pixel sensors, λ × N stays under 2p at F11 even in the infrared, so wavelength there is a pure contrast decision, covered in the monochrome camera colour contrast guide.
The decision, case by case
- Finest surface detail, static part, light to spare: blue or violet light, aperture as wide as depth of field allows, kept under λ × N ≤ 2p.
- Thin films, fringes or wrinkles to hide: infrared; accept 1.9 times the blue spot and open the aperture to compensate.
- Tall parts that need F11: blue, which holds the diffraction ceiling out to F15 on 3.45 µm pixels where red already softens at F11.
- Fast motion, weak signal: red light for photons; recover detail from the lens and sensor instead of the wavelength.
Next step: pick the LED colour and geometry with the light finder, pair it in machine vision lenses or the lens configurator, and browse the rest of the lighting guides on the lighting topic page. Application-specific questions go through the contact page.
Questions
How many more line pairs per millimetre does blue resolve than red?
The diffraction cutoff frequency is 1/(λN), so it scales inversely with wavelength. At F2.8 the cutoff sits at 776 lp/mm in blue light and 567 lp/mm in red light — about 37% more detail frequency from the same lens and aperture. The red-to-blue wavelength ratio of 1.37 applies at every f-number, so you can rescale the pair for your own working aperture.
Why does my image soften when I switch to infrared light?
The Airy disk diameter 2.44 × λ × N grows linearly with wavelength. The same lens at the same aperture that produces a 3.1 µm spot in blue light produces about 5.8 µm in the near-infrared, which puts almost 1.7 pixel pitches of blur on a 3.45 µm sensor. Open the aperture one or two stops, or drop back to a shorter wavelength, and the sharpness returns.
Does a colour camera gain the same benefit from blue light?
Not fully — run monochrome when resolution is the goal. A Bayer colour sensor passes blue light to only a quarter of its pixels, so the blue channel samples the scene at half the horizontal and vertical pitch, and demosaicing interpolates the rest. A monochrome sensor puts every pixel to work at the chosen wavelength, which is why fine-detail surface inspection pairs a single LED colour with a monochrome camera.
Can ultraviolet light improve resolution further?
Yes, with diminishing returns. At 365 nm the F2.8 Airy diameter is about 2.5 µm, some 20% below the blue spot. Against that, silicon sensor response and ordinary glass transmission both fall steeply below 400 nm, so expect a longer exposure or a stronger LED, optics specified for UV, and eye protection. Test 365-405 nm on sample parts before committing a station.
Do I need to refocus when I change LED colour?
Usually by a small amount. Lenses are chromatically corrected, not chromatically perfect: best focus shifts, typically by tens of microns between deep blue and near-infrared on machine vision lenses, more on units not corrected across the band. Focus and lock the barrel under the wavelength you will run, and for permanent infrared operation, lenses in the IR-corrected group hold focus across that band by design.


