Skip to content

[#53,#51] Region-based bg segmentation: fix solid-bg holes + --background <color>#55

Merged
realproject7 merged 1 commit into
mainfrom
task/53-bg-segmentation
Jun 20, 2026
Merged

[#53,#51] Region-based bg segmentation: fix solid-bg holes + --background <color>#55
realproject7 merged 1 commit into
mainfrom
task/53-bg-segmentation

Conversation

@realproject7

Copy link
Copy Markdown
Owner

Extracts a shared edge-flood-fill mask so subject/background is connectivity-based, not color-based.

96 tests pass + ruff clean. Visually verified (PO) on dog-pink-wall: ears intact, custom cream/solid backgrounds clean.

Closes #53, closes #51

🤖 Generated with Claude Code

…--background <color>

Extract a shared _edge_flood_fill_mask() in preprocess.py and use it for
both remove_background() and solid_background(), so the subject is defined
by connectivity (enclosed by its outline), not color. A subject region
that shares the background color — a pink dog-ear on a pink wall — is no
longer absorbed into the repainted background (no more see-through holes).

Add --background <color>: repaint the detected background to a chosen
color (hex or named via PIL.ImageColor); --solid-background == --background
auto. Backward-compatible, threaded through ConvertOptions.

Closes #53, closes #51

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@realproject7 realproject7 merged commit 0e5a2bb into main Jun 20, 2026
2 checks passed
@realproject7 realproject7 deleted the task/53-bg-segmentation branch June 20, 2026 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant