Repository navigation
Fill enclosed areas (paint letter interiors) + v0.5.0 - #13
Merged
Merged
Conversation
Blank spaces inside a design — letter interiors, the holes in an outlined mark — that match the background were detected as background and left as empty gaps, so they couldn't be painted. Fill them into the silhouette so they're detected as their own color and become paintable. Background touching the image border (the real outside) is left out. - raster.fill_enclosed() (scipy.ndimage.binary_fill_holes); RasterLoader.load gains a fill_holes flag. - Web: Session keeps the raw silhouette; detect/redetect take fillHoles and recompute the effective silhouette, so everything downstream (preview, meshes, printability) follows. app.jsx adds a "Fill enclosed areas" toggle that re-detects. - CLI/pipeline: --fill-holes flag + PlateConfig.fill_holes. - tests/test_fill_holes.py (68 tests total). Verified on a real outlined logo: white letter interiors go from empty holes to a paintable White region. Release prep: bump to 0.5.0 and finalize the CHANGELOG. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
For logos where blank spaces inside the design — letter interiors, the holes in an outlined mark — match the background, those areas were detected as background and left as empty gaps you couldn't paint. This adds a toggle to fold them into the design so they become paintable colors.
How it works
raster.fill_enclosed()—scipy.ndimage.binary_fill_holesfills background that's enclosed by the design; background touching the image border (the real outside) is left out.RasterLoader.loadgains afill_holesflag.Sessionkeeps the raw silhouette;detect/redetecttakefillHolesand recompute the effective silhouette, so everything downstream (preview, meshes, printability) just follows.app.jsxadds a "Fill enclosed areas" checkbox under Max colors that re-detects.--fill-holes+PlateConfig.fill_holes.Verified
On the real outlined "FR/B" logo: before → Black + 3 greens, the white letters are empty holes; after → Black + White + greens, the letters fill in and are assignable.
tests/test_fill_holes.pycoversfill_enclosed, the service detect, the redetect endpoint, and the CLI pipeline. Full suite: 68 passing (3.10 + 3.12 in CI). No console errors; works across MMU / single-extruder / dark mode.Ships as v0.5.0. Auto-deploys to colorplate.spoolr.io on merge.
🤖 Generated with Claude Code