A ramp has no flat region to find
The palette stage works by finding the small set of colours the picture actually uses and assigning each pixel the nearest one. That works well for flat artwork. It breaks down on a smooth gradient, because a gradient has no flat colour to be assigned to — it only ever has the colour it happens to be at that point. The palette's only option is to quantise it: cut the ramp into bands, one per palette entry it crosses, and label each band as if it were its own solid colour.
Left uncorrected, each of those bands becomes its own separate flat shape in the output file. One synthetic test gradient came back described as four flat layers costing fifty-eight numbers in the file, where the honest description is a single gradient costing twelve.
The merging is done carefully, one weld at a time, and the actual saving in file size is checked before any two pieces are welded. Neighbouring pieces are only candidates for joining when at least one side is already recognised as part of a ramp, or when two flat bands are a small colour step apart across a boundary that changes gradually, pixel by pixel, the way the inside of a fade does — not in one sharp step, the way the edge between two separate inks does. Those checks run before any expensive fitting is attempted, so two unrelated flat regions are never fitted together just because a gradient could be drawn between them.
The welding has a fixed allowance of work, set by the size of the picture: a generous minimum for small images, and a fixed amount per pixel for very large ones. Every batch of trial fits is costed before it runs, and once the allowance would be overdrawn the merging simply stops. Every weld already made stands, and the remaining bands stay separate, correct flat or gradient fills — a slightly larger file, never a wrong one. The allowance is counted in work, not seconds, so the result is the same on every machine. No icon or logo in the test sets comes near it; what it stops is the photograph or textured print whose every region is a slight gradient, which used to keep this stage busy for many minutes. A time budget, when one is asked for, is now also checked between individual fits, not only between welds.
Choosing the cheapest honest description
Once a region is settled, this stage still has to decide what to fill it with. A flat colour, a straight-line fade and a circular or elliptical fade are all tried, and the cheapest one that actually explains the pixels wins. "Cheapest" is not vague: a flat fill costs the file three numbers, a straight fade costs ten, and a circular fade costs nine (eleven if it needs to be an ellipse rather than a perfect circle) — each extra colour stop along the way costs four more. A gradient is only chosen when the error it removes, compared with the simplest flat guess, is worth more than the extra numbers it costs to write down.
Two further guards keep the search honest. A gradient is not even attempted on a region with too few pixels to tell a real fade from noise. And a candidate fade must clear a visibility floor and actually shade a real portion of the region's pixels — otherwise it is not describing shading at all, it is spending a gradient's worth of numbers explaining a single lost dot or a chamfered corner.
A ramp, or two flat colours wearing a ramp's clothes
There is a harder case than picking a fill for genuine shading: telling a real gradient apart from two flat inks the palette happened to merge into one region. Both cases leave a flat guess with a high error, so comparing a candidate gradient only against the flat fit's own error cannot separate them — an earlier version of this test that tried exactly that ended up declining gradients almost everywhere.
What actually tells the two apart is how well each alternative explains the same pixels. Measured across the regions the tracer was wrongly leaving flat, the best single straight-line ramp removed only thirteen percent of the error there, while the best possible split into two flat colours removed sixty-six percent. That gap is the signature of a step, not a ramp: shading fades continuously and a two-colour split can only approximate it badly, while two genuinely distinct inks are matched almost perfectly by two flat colours and poorly by any smooth fade in between.
A feature stuck to a gradient
The palette only sees colours, not shapes, so a two-pixel white seam through a black shape, a stray dot, or the end of a thin stroke all quantise into the ink that surrounds them, disappearing into an otherwise flat region. The fill fitter then sees a solid region with a small stubborn cluster of pixels it cannot explain as flat, and its only remaining tool is to buy a gradient to cover the difference — real cases on solid black shapes came back fitted with as many as three separate radial gradients purely to explain seams that were never shading at all.
Before fill fitting runs, this stage looks specifically for small clusters of pixels whose colour sits well outside what the region's chosen fill predicts there, excluding anything that looks like ordinary anti-aliasing rather than a genuine feature. Each surviving cluster is carved out as its own small flat region, filled with its own measured colour, and the parent region is refitted without those pixels dragging its gradient search around. The threshold for "well outside" scales with the picture's own measured noise, with a floor so that genuine anti-aliasing fringes are never mistaken for a feature, and the number of features carved from a single image is capped, as a guard against a heavily textured region shattering into hundreds of tiny pieces.
On a transparent canvas there is one more step. A carved feature is named after the palette ink nearest its colour, judged over white — and over white, the empty background looks exactly like white paint. A small pale shape cut out of the empty background could therefore be named after the background itself, and drawn fully see-through. Now a carved shape that is mostly opaque is named after the nearest ink that actually draws something, so it is painted, not left clear. Faint anti-aliasing left inside the empty background stays clear.
Interpolation space is part of the model, not a rendering detail
A gradient can fade in one of two different ways: in the space the file's colours are actually stored in, or in the physical, light-intensity space a screen actually composites in. Both are genuinely used by real design tools, and they look visibly different for the same two end colours. Rather than assuming one, this stage fits a candidate in both spaces and lets the same cost comparison decide which one the picture's own pixels actually support — the winning choice is written into the file alongside the gradient itself, not left to the renderer's default.
This also matters for elliptical fades specifically: in one large emoji set, most of the radial gradients found were not circles but stretched ellipses. Fitting a plain circle to one of those is visibly wrong in a way no colour tolerance can paper over, so an elliptical radial model — with its own angle and aspect ratio — is tried alongside the circular one whenever a region calls for it.
Finding the centre of a fade that does not fade everywhere
Most radial fades an artist draws do not change colour all the way from the centre to the rim. Nearly three in four of the visible gradients in the emoji set hold one colour across a core and only start to darken near the edge, or rise and fall in a bump. The radial fitter used to place a fade's centre wherever a single straight ramp of colour fitted the region best — which, for a fade with a flat core, is not where the artist put the centre at all — and such fades came out painted flat four times as often as fades that change all the way across.
Since October 2026 every region that could take a radial fade is also searched with a fade allowed to bend: flat in the middle, steep at the rim, or anything between. The centre (and, for an ellipse, its angle and stretch) is found by a standard numerical method for exactly this kind of problem, in which the colours along the fade are solved for directly and only the shape of the fade is searched; it reaches the answer in about fifteen tries where the old search took hundreds. The fade it finds is offered alongside the old one, never instead of it, and the same cost comparison picks between them.
A guard comes with it: two regions are never joined into one fade across a seam where most neighbouring pixels jump in colour. Before this rule, the band between a princess's crown and her hair could be absorbed into the hair once a bending fade fitted both.
Finally, the cost comparison now prices what will actually be drawn. The file writer paints a fade whose colours are all within a just-noticeable difference of each other as one flat colour, halfway between its ends. A fade like that used to win the comparison on its own accuracy and then be drawn as something else; on a cookie emoji that turned an almost perfect fit of the biscuit into a visibly wrong flat colour. A fade the writer would flatten is now refused at the start, and the region is described by what will really be drawn.
A bending fade needs its bends in the right places. The colour stops inside a fade used to be placed one at a time, the first as if it were the only one; on a fade with a flat core, the first landed on the sharpest bend near the rim and the second split the rim again, so the core was drawn as a gentle slope it does not have. Now, once two stops are found, each is moved to its best place with the other held where it is — a standard refinement for exactly this kind of one-at-a-time search — and the core gets its stop. Together these changes lifted the share of the artist's fades recovered as one fade, on the 168 emoji whose original files contain gradients, from 42 to 50 percent, and cut the share painted flat from 30 to 24 percent; on the 512 pixel emoji of the regression set the colour error fell by about an eighth.
Why this stage costs the most time in the tracer
Searching for the best gradient — trying candidate axes, candidate centres, candidate interpolation spaces, and scoring each against the actual pixels — is the single most expensive part of the whole pipeline. On one particularly demanding image, disabling every other optional stage still left a trace taking 10.9 seconds; capping how many colours feed the search — which is what feeds the per-region gradient search — brought that down to 6.3 seconds. Skipping gradient fitting altogether and filling every region flat is offered as a genuine fast path for exactly this reason — not a cosmetic shortcut, but a real way to trade fidelity on shaded artwork for speed when speed is what matters.