Skip to content

[#54] --flatten-shading: collapse soft shading so gradients stop shattering#57

Merged
realproject7 merged 1 commit into
mainfrom
task/54-flatten-shading
Jun 20, 2026
Merged

[#54] --flatten-shading: collapse soft shading so gradients stop shattering#57
realproject7 merged 1 commit into
mainfrom
task/54-flatten-shading

Conversation

@realproject7

Copy link
Copy Markdown
Owner

Per the re-scope to Option 2: --flatten-shading runs a stronger edge-preserving bilateral pass before tracing, so smooth/glossy gradients (satin sheen) collapse into clean flat regions instead of shattering into tiny scratch facets. Opt-in, color mode; trades fine shading for a cleaner graphic look + much smaller file.

  • Parametrizes flatten_colors spatial sigma; the flag sets a strong flatten (sigma_color 0.18, spatial 8).
  • Warning now points at the flag.
  • 98 tests pass + ruff clean. Verified on the glossy anime: 6084 → 3319 paths, the satin scratch is gone.

(Options 1 = SVG gradient fills and 3 = postprocess sliver-merge were ruled out empirically — see the issue thread.)

Closes #54

🤖 Generated with Claude Code

Smooth/photographic gradients (e.g. satin sheen) otherwise shatter into many
tiny 'scratch' facets. --flatten-shading runs a stronger edge-preserving
bilateral pass (larger color + spatial sigma) in preprocess so the soft shading
collapses into clean flat regions before tracing — fewer facets, much smaller
file, at the cost of fine shading (opt-in, color mode). Parametrizes
flatten_colors' spatial sigma and points the photographic-gradients warning at
the new flag.

On the glossy-anime test: 6084 → 3319 paths, satin scratch gone.

Closes #54

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@realproject7 realproject7 merged commit e949d43 into main Jun 20, 2026
2 checks passed
@realproject7 realproject7 deleted the task/54-flatten-shading branch June 20, 2026 14:48
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.

quality: smooth/photographic gradients fragment into broken 'scratch' facets

1 participant