Skip to content

Land #653, #654, #656: Image Trace View modes, Palette and Create Strokes (part of #641) - #657

Merged
bflatastic merged 6 commits into
mainfrom
pr/land-641
Oct 9, 2026
Merged

bflatastic merged 6 commits into
mainfrom
pr/land-641

Conversation

@bflatastic

Copy link
Copy Markdown
Member

Lands the three Image Trace PRs for #641 together. They conflict with each other in the panel, the imageTrace.make params doc, the MCP prompt and the ROADMAP, so they're merged here with every side kept:

Verification

  • Full cargo xtask ci on this merge (fmt, clippy, tests, assets, brands, layers, wasm): all pass.
  • Live in the app, through the control channel:
    • synthetic line art (a ring, a wave and a diagonal) traced with Strokes into 2 stroked centre lines;
    • a four-colour image traced with Palette Automatic into exactly its 4 colours;
    • the View set to Outlines with Source Image, shown in the panel and in Properties;
    • the panel showed the Advanced header open with Create: Fills / Strokes and the Stroke width.
  • The new centre-line code was reviewed for panics: neighbour indexing only runs inside a grid with an empty border, and the thinning loops end because each pass removes a pixel or stops.

🤖 Generated with Claude Code

bflatastic and others added 6 commits October 9, 2026 09:33
… View modes

- The Image Trace panel's Advanced options sit under a full-width collapsible
  header (widgets::section_toggle, also used by New Document's Advanced
  Options); whether it is open is kept with the UI preferences.
- View: Tracing Result, Tracing Result with Outlines, Outlines, Outlines with
  Source Image and Source Image, in the panel, the Control bar and the
  Properties panel. The view is saved in the Image Trace object's settings
  (`trace.view`), kept when it is traced again, set with the new
  `imageTrace.setView` command (or `view` on imageTrace.make) and drawn by the
  canvas only (RenderOptions::trace_views): exports, printing and Expand keep
  the tracing result.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cument Library)

Color mode's colours now come from a Palette (`palette` in imageTrace.make's
params), shown in the Image Trace panel under Mode:
- Limited: the `colors` best colours (what Color did before; the default).
- Full Tone: median cut until no colour box spans more than 96 (Less) … 8
  (More) levels per channel, up to 256 colours, set by `colorDetail` 0-100
  (the panel's Colors slider for this palette).
- Automatic: flat art (90% of the pixels in a few tight colours) traces with
  exactly its colours, anything else as Full Tone.
- Document Library: the most used (at most `colors`) colours of the
  document's swatches or of a swatch library (`library`: "document" or a
  library id or name, chosen in the panel's Library list), used as they are;
  traced shapes fill with the swatch's own colour, its colour model kept.
  The library's colours are looked up at every trace, not saved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Advanced › Create: Fills and/or Strokes, with Stroke (the widest line, px).
With Strokes, each colour's 8-connected parts no wider than the stroke width
(chamfer distance transform) trace as open centre lines instead of filled
outlines: the line is thinned to one pixel (Zhang-Suen with each removal
re-checked, so two-pixel lines survive; staircase corners dropped), its
skeleton becomes runs between ends and junctions (junction pixels merged,
spurs pruned, runs through two-way junctions joined, rings closed), and each
run is simplified and fitted with curves. The stroke width is the line's mean
width (pixels over length). Traced lines get round caps and joins in the
document. Without Fills, wider areas become 1 px stroked outlines.
`imageTrace.make` takes fills, strokes and strokeWidth, and refuses neither
fills nor strokes and a non-positive width.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ment Library)

# Conflicts:
#	ROADMAP.md
#	crates/engine/src/cmd/buildcmds.rs
#	crates/ui-egui/src/panels/image_trace.rs
# Conflicts:
#	ROADMAP.md
#	crates/engine/src/cmd/buildcmds.rs
#	crates/engine/src/tests_build.rs
#	crates/mcp/src/prompts.rs
#	crates/trace/src/tests.rs
#	crates/ui-egui/src/panels/image_trace.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant