mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-14 05:24:44 +00:00
Merge pull request #7204 from dotCooCoo/fix/trace-overlapping-two-pass
Image Trace: Overlapping fills each shape whole and stacks what it encloses above it
This commit is contained in:
@@ -86,7 +86,19 @@ size. Raster exports with Art Optimized anti-aliasing, the default, do not show
|
||||
pixels and 16,384 pixels on a side. A raster export shows the line as the canvas does when it uses
|
||||
Type Optimized anti-aliasing, or when it uses Art Optimized and is larger than either limit.
|
||||
Overlapping stacks the colors instead: a lower color continues under the edge of the color above it,
|
||||
and no background shows along that edge.
|
||||
and no background shows along that edge. With Fills and without Create Strokes, Overlapping also
|
||||
follows a fill rule of VectorCraft's own: each shape is filled whole, and the area of other colors
|
||||
that a shape encloses is traced again as shapes of its own and stacked above it. Each enclosed
|
||||
outline is then fitted once. The [Image Trace presets](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/image-trace-presets.html)
|
||||
page describes Overlapping as stacking shapes where it can and overlapping their edges elsewhere. A
|
||||
shape keeps a hole where the enclosed area holds a transparent pixel or a color that Ignore Color or
|
||||
Keep Colors leaves out. A hole smaller than Noise is filled with the shape's own color, as before.
|
||||
The pixels of an area inside other areas are scanned once more for each area around it, within a
|
||||
work budget of VectorCraft's own: four times the image's pixels (counted as at least 65,536) times
|
||||
its colors, with each area costing its bounding box times the colors in it. An area that costs more
|
||||
than what is left of the budget keeps its holes and is not charged, so a smaller area after it can
|
||||
still be filled.
|
||||
With Create Strokes, or without Fills, shapes keep their holes.
|
||||
|
||||
**Flat Logo with named colors.** With `logoColors` named, Flat Logo decides whether the image is flat
|
||||
art by the image's own colors. It finds them the same way as when no colors are named, and looks for as
|
||||
|
||||
@@ -1374,6 +1374,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
- **Create Strokes baseline (2026-10-17, measured):** the ignored centre-lines class covers 23 exact code-drawn scenes in aa and hard variants, including junctions, crossings, fills meeting strokes and varying widths. [Baseline and metric definitions](image-trace-quality.md#centre-lines). Topology is recovered from emitted geometry; width-profile metrics remain unavailable. No behaviour change or score increase.
|
||||
- **Image Trace, collapsed loops keep few segments:** a loop whose fit collapses to one cubic keeps the fewest segments that hold its area and course, so a higher Paths gives no fewer segments; a code-drawn Paths sweep in `crates/trace` (see [quality notes](image-trace-quality.md#collapsed-loops-keep-few-segments)).
|
||||
- **Image Trace, stacked layers only under their own areas:** with Method Overlapping, a layer reaches under the colors above it only within the connected areas that hold its own color, so a shape that sits apart from a color is no longer written again, at the same bounds, in that color, and the edge of that color's layer no longer shows through that shape's anti-aliased rim. *Measured* by `crates/trace/tests/quality` on each preset's own inputs: High Fidelity Photo 121 paths to 69.6 with ΔE 1.74 to 1.72, Low Fidelity Photo 37.1 paths to 26.1. Code-drawn disc, square and line tests in `crates/trace`.
|
||||
- **Image Trace, Overlapping shapes filled whole:** with Method Overlapping and Fills (without Create Strokes), each shape is filled whole, and the area of other colors it encloses is traced again as shapes of its own and stacked above it, so each enclosed outline is fitted once; this fill rule and its work budget (four times the image's pixels, counted as at least 65,536, times its colors) are VectorCraft's own. A shape keeps a hole where the area holds a transparent pixel or a color left out, and an area past what is left of the budget keeps its holes. Expand by Color starts another group of a color where an area is drawn above the shape around it. Code-drawn nested disc, ring, frame, Keep Colors, transparency and budget tests in `crates/trace`.
|
||||
- **Image Trace, notches read only their own piece:** the notch rule of `subpixel::outline` reads only the shared piece, so both regions of an edge cut a corner pixel alike and leave no gap; a code-drawn noisy multi-colour coverage test in `crates/trace` (see [quality notes](image-trace-quality.md#notches-read-only-their-own-piece)).
|
||||
- **Image Trace, same shift from either side of an edge:** a crack's sub-pixel shift is averaged from its two sides, so abutting regions on one- and two-pixel slivers get the same points and leave nothing uncovered; code-drawn regressions in `crates/trace` (see [quality notes](image-trace-quality.md#same-sub-pixel-shift-from-either-side-of-an-edge)).
|
||||
- **Image Trace, band borders in smooth areas:** in Color and Grayscale traces, a border between two colors where the image changes gradually is the contour of a smooth area, by VectorCraft's own rule (`subpixel::low_contrast`, distances measured in RGB, 0 to 255 a channel): next to the border the image makes less than half the step between the two colors; it makes more of the step a few pixels further out, or changes by a distance under 12 (about 7 levels in each channel of a gray); the pixels on each side change too; and its whole change next to the border is under twice its change from one color towards the other, or under 24. Grayscale reads each pixel as its gray, for this rule and for every edge's sub-pixel position. Such a border is smoothed over about 4 px instead of 0.5 px (0.9 px for an edge without anti-aliasing), keeps no corners and is fitted to at least 0.5 px, so band borders in photos and gradients follow the image's contours with fewer anchors; without Shapes, both colors beside it share the same curve. Color traces of clean flat-color art and Black and White traces are unchanged, Grayscale traces of colored art place their edges closer to the art's outlines, and noisy flat-color art can take fewer anchors where noise splits a color into bands; see [quality notes](image-trace-quality.md#band-borders-in-smooth-areas). Tests: `tests::the_borders_of_a_gradients_bands_follow_its_contours`, `layers::tests` and `subpixel::tests` in `crates/trace`. Scores and hours unchanged.
|
||||
|
||||
Reference in New Issue
Block a user