Add Line Trace image import algorithm for line drawings#345
Open
olavl wants to merge 3 commits intojeffeb3:masterfrom
Open
Add Line Trace image import algorithm for line drawings#345olavl wants to merge 3 commits intojeffeb3:masterfrom
olavl wants to merge 3 commits intojeffeb3:masterfrom
Conversation
Adds a new image import mode that traces actual drawn lines from line drawing images, instead of raster-scanning with brightness modulation. Uses skeleton-tracing-js (Zhang-Suen thinning + polyline extraction) to extract centerlines, then connects them into a single continuous path via nearest-neighbor ordering — suitable for sand table output. New settings: Threshold, Min segment length, Simplify tolerance. Also fixes imageAmplitude missing isVisible guard (was shown for Waves). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Allow users to draw directly on the preview canvas with mouse or touch. A pencil toggle button activates draw mode; mouse-up finalizes the stroke as a new Drawing layer with Douglas-Peucker simplification and Chaikin corner-cutting smoothing. Layers support free scaling and all existing transforms/effects. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…her res - Replace greedy nearest-neighbor path connection with Graph + Chinese Postman + Eulerian trail for optimal traversal of all detected segments - Add residual recovery pass that finds ink pixels missed by the skeleton tracer and traces them as additional polylines (toggleable checkbox) - Increase image canvas resolution from 800x600 to 1600x1200 to preserve fine details like eyes and thin strokes - Add "Thicken lines" (dilation) option for very faint line drawings - Reduce snap radius from 3 to 1 to prevent merging distinct nearby features - Default to zero simplification and zero min segment length for max fidelity Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
imageAmplitudeoption missingisVisibleguard (was incorrectly shown for Waves)Motivation
The existing 6 image import algorithms (Squiggle, Spiral, etc.) all treat the image as a tone map and modulate waveforms based on pixel brightness. For images that are already line drawings, users want the sand table ball to trace the actual lines rather than producing a raster pattern. This new algorithm fills that gap.
How it works
pixelProcessorapplies brightness/contrast/inversion (existing controls)TraceSkeleton.fromBoolArray()skeletonizes and extracts polylinesTest plan
npm run buildsucceeds🤖 Generated with Claude Code