Image Trace: preset docs name the enhanced versions and older figures

The preset paragraphs say that the enhanced versions use the same Paths,
Corners and Noise, and that Corners 50 applies to the other eight
presets. The quality notes add the staircase and anchor rises in Line
Art, Outline, 3 Colors, Sketched Art and Silhouettes, and say which
figures were measured at the earlier values. The anchor-limit comments
name the same settings in both places.
This commit is contained in:
dotCooCoo
2026-11-13 21:22:12 -08:00
parent f384398494
commit 090293db4e
4 changed files with 18 additions and 14 deletions
+6 -6
View File
@@ -288,10 +288,10 @@ fn trace_library(c: &str, s: &Session, params: &mut tr::TraceParams) -> Result<V
/// The most anchor points an Image Trace may make, a guard for memory: a trace past it is refused
/// with advice instead (#525). A trace keeps about 90 bytes an anchor in the document (measured on
/// code-drawn photos of 2000 × 2000 to 6000 × 4000 pixels), so 8,000,000 anchors are about
/// 0.7 GB, with a peak of about 1 GB while tracing: a 4000 × 3000 photo at Limited 64 colors, Paths
/// 90, Corners 25 and Noise 4 makes about 1.9 million, and even at Paths 100, Noise 1 and every tone
/// about 7.9 million. On the
/// web, where a page has at most 4 GB of memory, the limit stays at 2,000,000.
/// 0.7 GB, with a peak of about 1 GB while tracing: a 4000 × 3000 photo at Limited 64 colors,
/// Paths 90, Corners 25 and Noise 4 makes about 1.9 million, and even at Paths 100, Noise 1 and
/// every tone about 7.9 million. On the web, where a page has at most 4 GB of memory, the limit
/// stays at 2,000,000.
#[cfg(not(target_arch = "wasm32"))]
pub const MAX_TRACE_ANCHORS: usize = 8_000_000;
@@ -1136,7 +1136,7 @@ mod trace_limit_tests {
assert_eq!(w, ["Flat Logo traced the image at 946 × 710 pixels, averaged down from 16000 × 12000."]);
}
// A 4000 × 3000 photo at Limited 64 colors, Paths 90 and Noise 4 makes about 1.9 million anchors, which must fit;
// the limit still guards memory (about 90 bytes an anchor). Checked when the tests build.
// A 4000 × 3000 photo at Limited 64 colors, Paths 90, Corners 25 and Noise 4 makes about
// 1.9 million anchors, which must fit; the limit still guards memory (about 90 bytes an anchor). Checked when the tests build.
const _: () = assert!(MAX_TRACE_ANCHORS >= 2_000_000 && MAX_TRACE_ANCHORS <= 16_000_000);
}
+3 -3
View File
@@ -18,9 +18,9 @@ its current location. Opening the controls does not add a document undo step.
| Create | Fills / Strokes | Creates filled areas, stroked lines, or both. |
| Ignore Color | Color picker | Leaves out the selected color (white by default). |
The built-in presets other than Auto Color and Flat Logo all use Paths 50. Corners is 100 in
Technical Drawing, 75 in Default, Black and White Logo, Line Art and Outline, and 50 in the others.
Noise is 1 px in Technical Drawing, 5 in High Fidelity Photo, 10 in Low Fidelity Photo, 15 in 3 Colors,
The built-in presets other than Auto Color and Flat Logo all use Paths 50, and so do their enhanced
versions. Among those presets, Corners is 100 in Technical Drawing, 75 in Default, Black and White
Logo, Line Art and Outline, and 50 in the other eight. Noise is 1 px in Technical Drawing, 5 in High Fidelity Photo, 10 in Low Fidelity Photo, 15 in 3 Colors,
6 Colors, 16 Colors and Shades of Gray, 20 in Sketched Art, Line Art and Outline, 25 in Default and
Black and White Logo, and 90 in Silhouettes (see
[image-trace-quality.md](image-trace-quality.md#preset-paths-corners-and-noise)).
+8 -4
View File
@@ -247,7 +247,8 @@ Every built-in preset other than Auto Color and Flat Logo traces at Paths 50. Co
| Technical Drawing | 50 | 100 | 1 | 95, 90, 4 |
| Outline | 50 | 75 | 20 | 80, 70, 10 |
The palettes, color counts, thresholds and other options of the presets did not change.
The palettes, color counts, thresholds and other options of the presets did not change. The enhanced
versions of these presets use the same Paths, Corners and Noise.
Measured with the harness below (section 1, each preset on the inputs it is meant for), before and after:
anchors fall in 10 of the 12 changed presets, for example 5,494 to 3,136 (High Fidelity Photo), 33 to 27
@@ -255,14 +256,17 @@ anchors fall in 10 of the 12 changed presets, for example 5,494 to 3,136 (High F
Sketched Art does not change. Outlines on flat art lie further from the true edge: off mean 0.100 to 0.123
px (16 Colors), 0.101 to 0.119 (6 Colors), 0.104 to 0.129 (3 Colors), 0.064 to 0.092 (Black and White Logo)
and 0.056 to 0.074 (Line Art), and off max 1.00 to 1.16 px in 6 Colors and 16 Colors. Technical Drawing
leaves 1.4 specks (was 0.5), and Outline's stroked centre lines lie 0.095 px off (was 0.086) with 2.7
leaves 1.4 specks (was 0.5), and Outline's stroked center lines lie 0.095 px off (was 0.086) with 2.7
anchors a stroke (was 3.0). ΔE changes by 0.01 or less except Line Art and Outline (2.62 and 2.61 to 2.66
and 2.67); edge ΔE rises in 8 of the 12, for example 4.79 to 5.25 (16 Colors), 3.98 to 4.46 (3 Colors) and 9.46 to 10.03
(Black and White Logo). On synthetic shapes and photos of 300 to 4,000 px traced outside this harness,
High Fidelity Photo makes 41% fewer anchors and 16 Colors 20% fewer; the mean pixel difference of each
trace changes by −0.23 to +0.26 of a level; 16 Colors leaves 41 staircases of steps of 2 px or more where it left 40, High
Fidelity Photo 440 where it left 391, and Low Fidelity Photo 96 where it left 77. The tables below are the previous
measurement, not a rerun.
Fidelity Photo 440 where it left 391, Low Fidelity Photo 96 where it left 77, Line Art 17 where it left 13, Outline 13
where it left 10 and 3 Colors 14 where it left 12. On the same images Sketched Art makes 4,084 anchors where it made
3,936 and Silhouettes 1,608 where it made 1,578. The figures for these twelve presets and their enhanced versions in
the other sections of this file, and in the Image Trace entries of
[target-app-parity.md](target-app-parity.md), were measured at the earlier values.
Test: `presets_have_their_paths_corners_and_noise` in `crates/trace/src/tests.rs`.
## A simpler contour walk
File diff suppressed because one or more lines are too long