The grid corner was never the real answer
Once the previous stage has decided which regions are which and how they connect, every boundary point it produced sits on an exact pixel-grid corner — a whole number, or a whole number and a half. That is a coordinate the label map can express, not a coordinate a curved edge would ever naturally land on. A real boundary drawn by hand or by a design tool almost never falls exactly on a grid line; it crosses the grid wherever the artist put it, and the label map can only round that true position to the nearest corner.
This stage moves each point away from that rounded corner, back onto the position the anti-aliased image itself reports the edge to be — the same coverage measurement described earlier in this pipeline, now used to place a point rather than merely to describe a pixel.
Getting the physics of a pixel right
Moving a point sounds simple — find where the coverage measurement crosses halfway, and put the point there — but doing it carelessly introduces a systematic, repeatable bias, not random error. An earlier version of this stage blended between whole pixel centres in a way that consistently pulled every edge towards the grid, by amounts measured at 0.19 pixels on straight boundaries and enough, on one real icon whose edges genuinely fall at a fraction of a pixel, to lose 2.5 percent of its ink outright.
Three separate, measured corrections were needed to fix this properly:
- How much a pixel's coverage changes as the edge moves depends on the angle the edge crosses at — a boundary running straight across a pixel changes coverage differently than one crossing diagonally. Getting the wrong one of the two natural choices here was found to push every diagonal and curved edge outward by up to twice as much as it should — rounded shapes came back uniformly too fat.
- The relationship between coverage and position is not a straight line except along the pixel's own axes. At a true forty-five degree angle it curves, and using the straight-line approximation there put a ninety-percent-covered pixel's edge at 0.57 pixels from centre when the true position was 0.39 — slanted strokes came out fat by a tenth to a fifth of a pixel. The fix inverts the exact coverage of a square pixel rather than a linear stand-in for it.
- Only the two measurements that actually straddle the edge are used — averaging in a third, already-saturated reading was found to pull a point half a pixel into a stroke narrower than two pixels wide, because that third reading was contaminated by the stroke's other edge.
Not every boundary is a clean step
The exact inversion above assumes the edge is a genuine step from one flat colour to another. Two situations break that assumption, and this stage detects both before choosing which method to trust:
A soft boundary — the seam between two gradient bands, the edge of a shadow — is a gradual ramp, not a step, and reading it as one throws the point out by as much as a full pixel on synthetic tests built specifically to check this. A stroke narrower than about two pixels is a ridge with background on both sides rather than a single step, and reading it as a step is even more damaging — one synthetic test of thin strokes went from an error of 0.91 to 3.00 once the step method was wrongly applied there. Whenever a boundary looks like either of these — not flat on both sides, not rising smoothly to saturation, or simply too low in contrast to trust — this stage falls back to a direct numerical search for the fifty-percent crossing along the edge's own normal instead of the exact but narrower step formula.
An honest error bar travels with every point
Alongside its new position, every point also receives a positional uncertainty — the same idea introduced earlier in the pipeline, now attached to an individual point rather than a whole pixel row. A crisp, high-contrast edge is pinned down tightly; a faint, low-contrast one is pinned down loosely, because the same amount of pixel noise represents a much larger uncertainty in position when the two colours on either side are close together. There is also a floor on how precisely this method can ever locate an edge at all, measured on perfectly known test shapes, which is folded in alongside the noise-driven part rather than replacing it.
Junctions need a different method entirely
Where three or more boundaries meet at one point, the two-colour reasoning this stage otherwise relies on breaks down — the pixels there are a genuine mixture of three or more colours, and there is no single edge normal to search along. Moving each incident boundary's endpoint independently, along its own local direction, was tried and produced a visibly wrong result: every edge meeting at the junction disagreed slightly about where the junction actually was, each still within about half a pixel of the original grid corner, but pulling every touching face toward a slightly different point.
Junctions are instead handled as their own separate problem: each incident boundary's approach direction is estimated from its own already-placed nearby points, and the junction's true position is taken as the point that best agrees with every one of those approach directions at once, weighted by how confident each one is. Where two boundaries meet at a shallow, glancing angle rather than crossing cleanly, that agreement calculation becomes unreliable by its very nature, and a separate method built specifically for a tapering meeting point is used instead.
A feature that was tried, and shipped off
It is tempting to spend even fewer points on a faint boundary than its honest uncertainty already implies, on the reasoning that a viewer cannot see position error on a boundary they can barely see at all. That idea exists in the code, as an optional switch, and the underlying logic is sound: on two otherwise identical wavy test edges, one at strong contrast and one very faint, the tracer without this switch spent a nearly identical number of points on each — the right answer to "where is the edge" and arguably the wrong answer to "how much does this edge's exact position matter."
Measured on a 246-icon screen set, though, turning it on saved a very small fraction of the file's total points and cost a larger fraction of colour accuracy in return — most of that test set is high-contrast artwork where the faint case barely arises, so the measurement mostly sees the cost and not the benefit. It ships switched off by default for that reason.