mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-12 21:56:24 +00:00
In a gradient or a shaded area the palette colors on either side of a band border differ by more than the image changes across it, so pixel noise decided where the border ran, and it was smoothed over 0.5 px like a real edge: borders wobbled, kept stair steps and took many anchors. Each crack between two colors now records how much of the step between them the image makes next to it and a few pixels further out, how much the image changes there along the line between the two colors and in any direction, and how much it changes within each side (RGB distances, 0 to 255 a channel). A piece of outline is the contour of a smooth area when its cracks show less than half of the step; either more of it further out, a change along the line under 12, or no opaque pixels further out; some change within the sides, at least 1/32 of the change along the line; and a whole change under twice the change along the line, or under 24. Such a piece is smoothed over 4 px (a closed one over at most an eighth of its smaller width or height), keeps no corners, is fitted to at least 0.5 px and is checked against its smoothed points. The values are the same from either side of the crack. Grayscale reads each pixel as its gray, for this rule and for every edge's sub-pixel shift, which compared the pixels' colors with gray palette entries. Color traces of clean flat-color art and Black and White traces are unchanged. Specks rise by up to 0.8 per image on gradient and photo inputs, and Auto Color with Shapes leaves a 0.3 px gap there. Docs: docs/target-app-parity.md, docs/image-trace-quality.md.