Skip to content

[#76] Line-quality Phase 0: axis-snap + smooth-gate fix + gated dark-outline snap#77

Merged
realproject7 merged 1 commit into
mainfrom
task/lineqa-phase0
Jun 25, 2026
Merged

[#76] Line-quality Phase 0: axis-snap + smooth-gate fix + gated dark-outline snap#77
realproject7 merged 1 commit into
mainfrom
task/lineqa-phase0

Conversation

@realproject7

Copy link
Copy Markdown
Owner

Fixes #76. Version 0.5.0 → 0.5.1. Three fidelity-safe line-quality wins, validated on a 23-image harness; see the issue for the measured table. Cleaner/straighter outlines on outlined-cartoon art (c_17 dark 47→1 & SSIM +0.034, c_15 311→192 paths visibly cleaner), no class leak (gradient/photo/line-free byte-identical or ±0.003), corpus goldens + full suite green, ruff clean, regression tests added. The only image past the −0.02 SSIM line is c_15 (−0.024) — the known SSIM metric inversion (it scores the cleaner output lower because the staircase overlaps the antialiased original); visually confirmed sharper. No competitor names anywhere.

…outline snap

Three fidelity-safe line-quality wins, loop-validated on a 23-image harness.

- smooth.py: _axis_snap post-pass — straight runs already classified by the fitter,
  if within ~10deg of an exact 0/45/90/135 axis, snap to exact (length-preserving,
  endpoint propagated as the pen so contours stay seamless, per-snap drift guard).
- pipeline.py: wobble-relief escape on the all-or-nothing smooth gate — keep the
  smoothed output when it cuts contour wobble >=25% within a 0.10 SSIM hard floor,
  even when the plain 0.06 tolerance would veto the visibly-sharper result (SSIM
  rewards the antialiased staircase). The 0.06 safety net is unchanged.
- preprocess.py/postprocess.py/pipeline.py: gated dark-outline palette-snap — on the
  coverage path, collapse scattered near-black outline tints to one clean #000000
  layer (luma/DeltaE snap + palette exclusion + output-side fill snap), NO morph
  erosion. Class-gated (near-black-mass pre-gate) and SSIM-guarded.

Harness medians baseline->after: axis_purity 0.199->0.233, jitter 0.427->0.387,
dark_colors 33->22, SSIM 0.908->0.907 (flat). c_17 dark 47->1 SSIM +0.034; c_15
dark 125->26 paths 311->192 (cleaner outlines, visually confirmed); c_41 axis +0.10.
Only c_15 crosses -0.02 SSIM (the known SSIM metric inversion on the staircase).
No class leak; corpus goldens + full suite green; ruff clean. Tests added for
_axis_snap and snap_dark_fills. Version 0.5.0 -> 0.5.1.

Fixes #76

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@realproject7 realproject7 merged commit af3d846 into main Jun 25, 2026
4 checks passed
@realproject7 realproject7 deleted the task/lineqa-phase0 branch June 25, 2026 04:20
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.

Line-quality Phase 0: axis-snap + smooth-gate fix + gated dark-outline snap

1 participant