mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-14 19:26:56 -04:00
Create: Strokes (the Outline preset, or the option) traced lines along the pixel skeleton: right to a pixel, with a width counted in pixels, and fitted by a separate, older fitter. - Each skeleton point is moved to the middle of the line's ink, read from the image across the line: every pixel counts as much ink as its colour is the line's rather than the paper's, the ink's centroid is the middle and its sum the width (an anti-aliased or blurred line says both to a fraction of a pixel). - The stroke width is the median of those widths, no longer a whole number of pixels. - Each end goes where the ink ends, less the half width a round cap adds. - Centre lines are fitted as outlines are: a straight line is two anchors, corners stay corners, Snap Curves To Lines levels them. The old Douglas-Peucker and simplify fitter, and the crate's pathops dependency, go. Outline on the thin-line inputs, all sizes and variants (docs/image-trace-quality.md), before -> after: - painted outline 0.310 -> 0.055 px off on average; 81 -> 14 anchors for five lines - centre line 0.295 -> 0.052 px from the true centre line; stroke width 0.13 -> 0.02 px off; 18.4 -> 2.7 anchors a stroke (blurred, noisy and scanned lines: 2.0 each; aliased: 4.6) - largest distance 1.84 -> 2.94 px: the square ends of a 10 px line under a round cap Presets without Create: Strokes are unchanged.
20 lines
483 B
TOML
20 lines
483 B
TOML
[package]
|
|
name = "vectorcraft-trace"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
description = "VectorCraft Image Trace: raster to vector tracing (quantize, boundary follow, polygon, Bezier fit)"
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[dependencies]
|
|
vectorcraft-geom = { workspace = true }
|
|
kurbo = { workspace = true }
|
|
image = { workspace = true }
|
|
serde = { workspace = true }
|
|
thiserror = { workspace = true }
|
|
|
|
[dev-dependencies]
|
|
serde_json = { workspace = true }
|