Coffee & Tea CultureCoffee & Tea Culture

Color Sorting of Green Coffee: Optical Defect Removal at the Dry Mill

By Coffee & Tea Culture Team

Color Sorting of Green Coffee: Optical Defect Removal at the Dry Mill

Green coffee arrives at the dry mill as a fast-moving river of beans, and not every bean in it belongs in the final lot. Some are black, some are sour, some never ripened, some carry an insect's tunnel, and a few are not beans at all but pebbles, twigs or shards of husk. Removing them by hand, one by one, is slow and expensive. This is where optical machines take over. Color sorting is the high-speed electronic step that scans the stream, compares every bean against a stored color standard, and flicks out the ones that fail, all in fractions of a second.

It is one of the last automated cleaning stages before green coffee is bagged and shipped, and it has quietly become standard equipment at commercial mills worldwide. Understanding what a sorter can and cannot see, and where it sits among the other cleaning steps, explains why a modern lot can arrive remarkably clean, and why the best mills still keep people watching the belt.

Where color sorting fits in the dry mill

Color sorting is a finishing step, not a starting point. It only works well once the coffee has already been reduced to bare green beans and roughly organized by size and weight. The usual order at a dry mill runs like this:

  1. Hulling. Dried parchment (or the whole dried cherry, in naturals) is stripped off to expose the green bean. See coffee hulling for how this first step works.
  2. Screen sizing. Beans tumble across perforated screens that separate them by width, so that later machines see a more uniform stream.
  3. Density or gravity grading. Vibrating gravity tables and pneumatic separators sort beans by weight, pulling out light, low-density beans. This is covered in depth in coffee density grading.
  4. Color sorting. Optical machines scan the size- and density-graded stream and eject beans that fall outside the accepted color range.
  5. Hand-sorting and bagging. Optional human inspection catches what the machines missed, and the finished lot is weighed into bags.

Placing the optical stage near the end is deliberate. Feeding it beans that are already close in size and density lets the cameras compare like with like, which makes color differences stand out cleanly. For the wider picture of how these stages connect, see dry mill versus wet mill coffee. Color sorting is one specialised tool inside the broader family of methods described in coffee sorting; it is not the whole of sorting, and it is a different job from the size-and-defect-count logic of coffee grading.

How color sorting works: cameras, sensors and air jets

An optical sorter is essentially three systems working in sync: a feed that presents beans one at a time, an imaging system that judges each bean, and an ejection system that removes the rejects.

Coffee is metered from a hopper onto a vibrating feeder, then sent down an inclined chute or along a belt that spreads the beans into thin, evenly spaced lanes. As each bean leaves the chute it passes through a brightly and evenly lit viewing zone. There, high-resolution line-scan cameras, historically built around CCD sensors reading in the visible spectrum, capture the bean against a calibrated background thousands of times per second. Software compares the bean's color values to a stored "good" standard. If the bean falls outside the accepted tolerance, the machine notes its exact position in the falling stream.

A few centimetres further down, a bank of fast solenoid valves fires a precise, short burst of compressed air at the flagged bean, knocking it sideways out of the main flow and into a reject channel. Good beans continue undisturbed into the accept channel. The whole sequence, from imaging to ejection, happens in milliseconds, which is what allows a single module to process a heavy, continuous flow. Because a puff of air is blunt compared with a single bean, some good beans inevitably get caught in the same burst; this trade-off is central to how sorters are tuned, and we return to it below.

Monochromatic, bichromatic, trichromatic and NIR sorters

Not all sorters see the same way. Machines are commonly classified by how many optical channels they use to judge each bean:

TypeWhat it seesTypical use
MonochromaticA single channel or waveband (light/dark contrast)Basic removal of clearly black or clearly pale beans
BichromaticTwo channels compared against each otherSeparating subtler tones that a single channel confuses
Trichromatic (full RGB)Full visible-color spectrum with fine shade resolutionCatching small differences in green, brown and amber
NIR / InGaAsNear-infrared beyond visible lightForeign material and defects that share the color of good beans

The near-infrared channel deserves special mention. An InGaAs (indium gallium arsenide) sensor reads reflected light in wavelengths the human eye and an ordinary camera cannot. Plant material, glass, some plastics and stones absorb and reflect near-infrared energy differently from a sound coffee bean, so an NIR channel can flag contaminants that look, in visible light, almost identical to good coffee. High-end machines stack several of these technologies together, running visible RGB and NIR channels in parallel so that a bean has to pass every test to be accepted. Many modern units are also trained by example rather than by numeric threshold alone, with an operator showing the machine samples labelled "too dark," "just right" and "too light" so it can learn the boundary.

What color sorting removes

The point of the whole exercise is defect removal, and a well-set optical sorter targets a predictable list. Most of these correspond to the primary defects catalogued in coffee defects explained:

  • Black beans. Fully or partly black beans, usually from overfermentation or beans that fell to the ground, are the clearest targets. Their dark color contrasts sharply with sound green, so even a simple monochromatic sorter removes them well.
  • Sour and "stinker" beans. These are amber, brownish or reddish rather than clean green. They are harder to catch, because their color overlaps with acceptable beans and some sour beans look normal from the outside; sorters reduce them but rarely eliminate them entirely.
  • Immature beans (future quakers). Underripe beans are pale and low in sugar. A color sorter removes the more obviously off-color ones, but many immature beans only betray themselves after roasting, when they stay blond, so green-stage sorting reduces quakers without fully guaranteeing their absence.
  • Insect-damaged beans. Beans bored by the coffee berry borer often show dark tunnels or spots that the cameras pick up.
  • Foreign matter. Stones, sticks, husk fragments, dried cherry, and, with NIR channels, glass and metal that colour cameras alone would miss.

The honest caveat is that a color sorter judges only what it can see on the surface. A defect with normal outward color, such as a fully internal sour bean, can slip through, which is one reason optical sorting is paired with other methods rather than trusted alone.

Calibration, throughput and the false-eject trade-off

Every optical sorter is a compromise between purity and yield, and that compromise is set at calibration. The operator defines how far a bean's color may drift from the standard before it is ejected. Tighten that tolerance and the accept stream gets cleaner, but the machine also starts ejecting borderline-good beans; this is the false eject (or false reject), and it means saleable coffee ends up in the reject bin. Loosen the tolerance and yield rises, but more genuine defects survive into the final lot.

Mills manage this in a practical way: the reject stream is not thrown away but usually run through the sorter a second time (or a secondary machine) at a different setting, so that the good beans caught in the first pass are recovered while the true defects are concentrated for downgrading. Throughput depends heavily on machine size, the number of chutes and how dirty the coffee is; a commercial module commonly handles on the order of hundreds of kilograms of green coffee per hour, with cleaner, more uniform input running faster than heavily defective lots. Calibration is not "set once": lighting, dust on the optics, and even a change of origin or crop year can shift the color baseline, so standards are re-checked regularly.

Why color sorting complements hand-sorting and density sorting

It is tempting to see the optical sorter as a replacement for slower methods. It is not; it is one layer in a defence in depth, and each layer catches what the others miss.

Density sorting judges beans by mass, not appearance. It removes light, hollow, badly insect-eaten and many immature beans regardless of their color, catching defects that look perfectly normal to a camera. Color sorting does the reverse, removing off-color beans that may weigh the same as good ones. Running density grading first and color sorting second means a defect has to fool two completely different physical tests.

Hand-sorting remains the final safety net, especially for high-scoring specialty lots. A trained sorter on a belt can recognise subtle or ambiguous defects that fall in the grey zone of a machine's tolerance, and can make judgement calls no fixed threshold captures. Many top mills therefore run color sorting to do the heavy, high-volume work and reserve human eyes for a final pass.

There is also a second place optical sorting appears: after roasting. Because quakers only turn conspicuously pale once roasted, some roasters run a color sorter on roasted beans specifically to pull those blond immatures out, a job the green-stage sorter cannot fully do. Seen this way, color sorting is less a single machine than a strategy applied wherever color reveals a defect, working alongside weight-based and human sorting rather than instead of them.

Frequently asked questions

What does color sorting remove from green coffee?

It ejects beans and matter that fall outside the accepted color range: black beans, sour or "stinker" beans, many immature beans, insect-damaged beans, and foreign material such as stones, sticks, husk and, with near-infrared channels, glass and metal. It judges surface appearance, so defects with normal colouring can still slip through.

Does color sorting replace hand-sorting?

No. Color sorting handles the high-volume, repetitive removal that would be slow by hand, but it complements manual hand-sorting rather than replacing it. Trained sorters catch ambiguous or borderline defects a machine's fixed tolerance misses, which is why many quality-focused mills still run a human pass on top lots.

What is the difference between monochromatic, bichromatic and trichromatic sorters?

They differ in how many optical channels judge each bean. Monochromatic uses a single channel for basic light-versus-dark contrast, bichromatic compares two channels to separate subtler tones, and trichromatic reads the full RGB color spectrum for fine shade differences. A separate near-infrared (InGaAs) channel adds detection of foreign matter and defects that look normal in visible light.

What are false ejects in color sorting?

A false eject is a good bean the machine removes by mistake, usually because it sat close to the color threshold or was caught in the air burst aimed at a neighbouring defect. Tighter tolerances raise purity but increase false ejects and lost yield, so mills often re-sort the reject stream to recover the good beans.

Where does color sorting fit in the dry-milling sequence?

It comes near the end. Coffee is first hulled, then graded by screen size and by density or gravity, and only then color sorted, so the cameras compare beans of similar size and weight. Optional hand-sorting and bagging follow, making optical sorting one of the last cleaning steps before green coffee ships.

Frequently asked questions

What does color sorting remove from green coffee?
It ejects beans and matter that fall outside the accepted color range: black beans, sour or "stinker" beans, many immature beans, insect-damaged beans, and foreign material such as stones, sticks, husk and, with near-infrared channels, glass and metal. It judges surface appearance, so defects with normal colouring can still slip through.
Does color sorting replace hand-sorting?
No. Color sorting handles the high-volume, repetitive removal that would be slow by hand, but it complements manual hand-sorting rather than replacing it. Trained sorters catch ambiguous or borderline defects a machine's fixed tolerance misses, which is why many quality-focused mills still run a human pass on top lots.
What is the difference between monochromatic, bichromatic and trichromatic sorters?
They differ in how many optical channels judge each bean. Monochromatic uses a single channel for basic light-versus-dark contrast, bichromatic compares two channels to separate subtler tones, and trichromatic reads the full RGB color spectrum for fine shade differences. A separate near-infrared (InGaAs) channel adds detection of foreign matter and defects that look normal in visible light.
What are false ejects in color sorting?
A false eject is a good bean the machine removes by mistake, usually because it sat close to the color threshold or was caught in the air burst aimed at a neighbouring defect. Tighter tolerances raise purity but increase false ejects and lost yield, so mills often re-sort the reject stream to recover the good beans.
Where does color sorting fit in the dry-milling sequence?
It comes near the end. Coffee is first hulled, then graded by screen size and by density or gravity, and only then color sorted, so the cameras compare beans of similar size and weight. Optional hand-sorting and bagging follow, making optical sorting one of the last cleaning steps before green coffee ships.

Keep exploring

More brewing guides, tasting notes, and stories — from bean & leaf to cup.

Enjoying the guides?

We keep every guide free and ad-light. If this helped, buy us a coffee — it keeps the lights on and the next guide brewing.