When Noise picks the nearest color for a speck, the speck's average now
leaves out the semi-transparent pixels along a cut-out image's edge that
are the color beside them blended with the transparent background.
settle_cut_edges returns which pixels those are. A speck made only of
them merges by border. In Grayscale the speck's gray is read with luma,
the gray Grayscale traces with, and the test probe shift_probe denoises
as a trace does.
The docs now say the rule applies in Color and Grayscale (in Black and
White a region has only one neighboring color, so Black and White Logo
changes only by its Noise value), name `ea3f81d9c3` as the base of the
measurements, and say that the gradient-border test sets Noise 15
because at Noise 8 its borders stray 0.92 px against a 0.9 px limit.
A region below Noise joined the color it shares the longest border with, so
the specks of a thin dark line on a light ground joined the ground and the
line broke into dashes. When that color is 10 or more apart from the region's
own (Oklab x 100), the region now joins the neighboring color nearest its
source pixels, among the colors sharing at least a tenth of the longest
border. A single pixel tied between colors still joins by border.
6 Colors and 16 Colors move from Noise 15 to 8, and Black and White Logo from
25 to 5.
Regions are a linked list of pixels with a union-find over region ids instead of a Vec<usize> per region and BTreeMaps per merge. Same merge order and output; about 2.7x less peak memory and up to 1.9x faster on 25 MP noisy labels.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>