/v1/digitize collapses 4-color input to single white color — multi-color quantization broken #38
Labels
No labels
blocked:needs-attention
blocked:needs-decision
bug
feature-request
in-progress
needs-decompose
quickfix
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/easystitch-service#38
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug: /v1/digitize collapses multi-color PNGs to a single white color when the white background touches all non-background pixels
Reproduction (verified 2026-09-25)
Upload
pil_4color.png(200x200, 4 colored quadrants on white background):Service returned:
Single stitch object:
type=tatami_fill thread=#ffffff stitches=628500The 4 colored regions were all merged into one giant white fill — color quantization didn't fire.
Expected
A real digitizer with a 4-color input should return at least 4 stitch objects (one per non-background color). On the Brother PR-10 catalog (60+ thread entries) the expected output would be:
Why this matters
The whole product premise is "auto-digitize a multi-color image into stitchable thread objects." If 4 colored quadrants on a white background collapse to one white fill, the front-end will:
colorCount: 1Comparison: same service on the project fixtures works correctly
simple_square.png(black 50px square on white 100x100): 2 regions, 2 stitch objects, 2 colors (black + white). ✅solid_orange_box_64x64.png(orange 64x64 on white): 2 regions, 2 stitch objects, 2 colors (black + orange). ✅The difference: the project fixtures have only one non-background color. The 4-color fixture has four. The service appears to be treating multi-color inputs as if they were single-color.
Likely cause (not verified — would need source read)
Hypothesis from symptom shape: color quantization merges everything that touches the background border into the background color. The four quadrants each share an edge with the white background, so they get absorbed into the white region. Single-color fixtures don't trigger this because the only non-background region is the inner shape, which also touches the border — but in those cases the inner color wins somehow because there's only one competing color.
Alternative hypothesis: the service is running color reduction but at a higher level than expected (e.g., posterizing to 2 colors regardless of
maxColorssetting). ThemaxColors: 10setting was honored in the fixtures but ignored in the multi-color case.Severity
High. This is the single most important product feature. A user uploads a logo with 4 colors, sees a single white fill, assumes the digitizer is broken, and leaves. The "auto-digitize" product is non-functional for any input with more than one non-background color.
Reproduction script
Labels
Filed 2026-09-25 by user-driven bughunt session.