Commit Graph
7 Commits
Author SHA1 Message Date
dotCooCoo eee6fb51fd Image Trace: sepia, single-hue and duotone photos are smoothed as gray photos are
Color and Grayscale traces smoothed a gray photo before choosing its
colors, but a tinted photo with the same tones skipped smoothing: the
0.065 error rule applied only to pictures whose channels stay within 8
levels of each other. A picture whose opaque pixels lie, 19 in 20, within
6 levels of one tone curve now takes the same rule. The curve runs
through the median color of each 8-level stretch along the colors' main
direction, and a pixel on it must also lie within 6 levels of the plane
the colors spread along most, so art in several unrelated colors is not
counted. The sixteen-versus-eight exception still keeps clean flat art
on the flat-art route.
2026-11-12 11:39:53 -08:00
dotCooCoo 1854911078 Image Trace: gray photos are smoothed before tracing, as color photos are
The continuous-tone test asked whether 8 colors leave more than a tenth
of the error of one color. A gray picture's tones lie along one line,
where 8 colors come nearer to them, so some gray photos scored 0.078 to
0.093 and were traced as flat art, without the smoothing color photos
get. Their noise then mixed neighboring tones (a 16 Colors trace could
keep 10 or 12 colors) and stepped the edges.

A picture with at least 95% of its opaque pixels within 8 levels across
their channels now also counts as continuous tone when 8 colors leave
more than 0.065 of the error of one color, unless 16 colors leave at
most a fifth of the error of 8. These are VectorCraft's own values. The
exception keeps gray flat art of up to 16 clean levels on its old
route. Pictures with more than 5% of their opaque pixels outside that
8-level range are unchanged.

Anti-aliased or noisy gray flat art can now take the smoothed route as
well. Very noisy gray scans of flat art get fewer specks and staircase
edges; some gray illustrations and sketches get more anchors and
staircase edges at 16 Colors and High Fidelity Photo. Some 16 Colors
and High Fidelity Photo palettes of gray photos grow toward the
requested count, with more anchors and regions, and some 6 Colors
traces get more staircase edges.
2026-11-12 06:16:48 -08:00
vangel76andClaude Sonnet 5.5 c0465969c8 Denoise: comment fixes from review (#5462)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-04 08:13:25 +07:00
vangel76andClaude Sonnet 5.5 63b8c88168 Image Trace: noise removal keeps its regions in u32 arrays (#5462)
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>
2026-11-04 08:13:25 +07:00
Dylan M. Taylor 8f8d04e5b5 fix(trace): empty and mismatched rasters, swatch dedupe by set 2026-11-03 23:29:37 +07:00
Dylan M. Taylor 7b05e55a69 refactor(trace): separate graph construction and quantization 2026-10-27 17:47:12 +00:00
aiongg 22f59b6aea refactor(trace): move quantize.rs items to quantize/{cut_edge,denoise,palette,rare}.rs 2026-10-26 22:01:25 +00:00