mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-14 21:44:57 +00:00
With a gray among the colors, an anti-aliased edge pixel of black on white is also a mix of black and gray, or of gray and white, and the unmixing took the mix with the smallest error, which often held the gray. A black disc and a gray square on white traced the gray as the square plus 8 to 24 slivers around the disc, with the colors found or named exactly. When another mix of two classes also reproduces an edge pixel, the pixel now takes it if that mix's classes lie nearer in the flat areas around the pixel and the pixel has a neighbor on each side of the left-out class, along the line between the other two. Pixels within a few levels of a class outside a flat area are checked the same way, and they now count toward the number of pixel values that decides when a busy image is averaged down further. A flat area that stands for no class, as with colors named some levels off, counts as holding the classes of its mix, and so do the pixels of exactly its color joined to it. Whether a hard-edged image is softened is still judged from each pixel's best mix. The slivers are removed around sharp edges and edges blurred by up to about half a pixel; an edge blurred by a pixel or more, or pixel noise of a level or more, can still leave some. Gray strokes two and three pixels wide beside black stay gray, and so does a one-pixel gray line between black and white of at least 13 joined pixels. These trace as black and white: a shorter one-pixel line, or one that falls between pixels or is blurred; a soft-edged gray stroke about two pixels wide touching black; and most or all of a soft-edged stroke about three pixels wide touching black, 12 pixels long or less. Docs: docs/image-trace-adjustments.md, docs/target-app-parity.md.