[#54] --flatten-shading: collapse soft shading so gradients stop shattering#57
Merged
Conversation
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>
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.
Per the re-scope to Option 2:
--flatten-shadingruns 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.flatten_colorsspatial sigma; the flag sets a strong flatten (sigma_color 0.18, spatial 8).(Options 1 = SVG gradient fills and 3 = postprocess sliver-merge were ruled out empirically — see the issue thread.)
Closes #54
🤖 Generated with Claude Code