Skip to content

Fill enclosed areas (paint letter interiors) + v0.5.0 - #13

Merged
kurenn merged 1 commit into
mainfrom
feat/fill-enclosed
Jun 6, 2026
Merged

kurenn merged 1 commit into
mainfrom
feat/fill-enclosed

Conversation

@kurenn

@kurenn kurenn commented Jun 6, 2026

Copy link
Copy Markdown
Owner

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_holes fills background that's enclosed by the design; background touching the image border (the real outside) is left out. 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) just follows. app.jsx adds a "Fill enclosed areas" checkbox under Max colors that re-detects.
  • CLI — --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.py covers fill_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

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>
@kurenn
kurenn merged commit a9eda00 into main Jun 6, 2026
2 checks passed
@kurenn
kurenn deleted the feat/fill-enclosed branch June 6, 2026 00:23
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.

1 participant