Illustration-geometry knobs (supersample + dark-thin) + quality harness — loop-ready, default-off#73
Merged
Conversation
…ss — loop-ready, default-off Phase 0 of the daily quality loop: make the engine loop-ready by exposing the two confirmed illustration-geometry levers as tunable, default-OFF knobs, plus a reusable comparison harness. Both knobs default to 0 (off), so behaviour is unchanged — verified byte-identical to 0.4.1 on pigeon/logo/gradient/flat. They apply ONLY to the outlined low-res illustration class on the coverage path (gated by _supersample_candidate); gradients, photos, and high-res inputs ignore them. - ConvertOptions.illustration_supersample: trace the flat-colour mask at this resolution (e.g. 2048) so feather/scallop boundaries come out round and uniform. - ConvertOptions.illustration_dark_thin: erode the dark linework by this many steps so thick outline blobs become thin crescents (eye pupils / beak tip are protected by area). Implemented as preprocess._thin_dark + quantize_coverage(dark_thin=...). Known follow-up (loop R&D): the nearest-colour fill can leave faint grey, and high-res tracing inflates node count — a node-economical pass is the next lever (deliberately not stubbed here). - tools/quality_compare.py: given <folder>/inputs + <folder>/ref-svg, runs svgsmith with chosen knobs, writes ours/, builds input|ours|reference-target montages, and a metrics.md (SSIM to the reference OUTPUT — not the original — plus palette/paths/bytes). Outside src/, not packaged. Manual: ~/Projects/docs/MANUAL-svgsmith-quality-loop.md. Version 0.4.1 -> 0.4.2. Co-Authored-By: Claude Opus 4.8 <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.
Phase 0 of the daily quality loop (see
~/Projects/docs/MANUAL-svgsmith-quality-loop.md): make the engine loop-ready by exposing the two confirmed illustration-geometry levers as tunable, default-OFF knobs, plus a reusable comparison harness.No-regression by construction
Both knobs default to
0(off) → behaviour unchanged. Verified byte-identical to 0.4.1 (md5) on pigeon / logo / 16-gradient / 12-sticker. The knobs apply ONLY to the outlined low-res illustration class on the coverage path (gated by_supersample_candidate); gradients, photos, and high-res inputs ignore them.Knobs
ConvertOptions.illustration_supersample— trace the flat-colour mask at this resolution (e.g. 2048) → round, uniform feather/scallop boundaries (SSIM-to-reference 0.896 → ~0.93).ConvertOptions.illustration_dark_thin— erode the dark linework by N steps → thick outline blobs become thin crescents; eye pupils / beak tip protected by area. (preprocess._thin_dark+quantize_coverage(dark_thin=).)illustration_supersample=2048→ larger internal resolution).Harness
tools/quality_compare.py <folder> [--supersample N] [--dark-thin N]— given<folder>/inputs+<folder>/ref-svg, runs svgsmith with the chosen knobs →ours/, buildsinput | ours | reference targetmontages →montage/, writesmetrics.md(SSIM to the reference OUTPUT, not the original — the correct loop metric — plus palette/paths/bytes). Outsidesrc/, not packaged in the wheel.Known follow-ups (deliberately deferred to the loop's R&D — not stubbed)
Full suite green; ruff clean (
ruff check .). Version 0.4.1 → 0.4.2.