[GH-ISSUE #8447] [Issue]: Preserve colored foreground details during sprite matte cleanup #8356

Closed
opened 2026-11-07 16:42:26 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @SpicyMarinara on GitHub (Oct 29, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8447

Originally assigned to: @SpicyMarinara on GitHub.

Summary

Builtin sprite background cleanup can misclassify blue/cyan foreground details as green spill, removing narrow feather ribbons or recoloring non-matte details near the cutout edge.

Expected behavior

Flat chroma backgrounds, enclosed matte pockets and true spill should be removed while opaque blue/gold foreground details remain intact.

Actual behavior

The shared builtin cleanup uses green minus the average of red/blue as a spill score. Pale blue RGB(120,200,230) scores as positive green spill even though blue is its strongest channel. The subsequent neighborhood/projection passes can reduce alpha or rewrite foreground colors. A user also reported missing blue/gold ribbons between an intact green-background Wardrobe image and its Home cutout in Otome Hearth. The screenshots alone do not identify the cleanup engine or prove the exact runtime cause.

Steps to reproduce

  1. Construct an opaque PNG with a flat green matte and thin blue/cyan/gold foreground ribbons.
  2. Run the exported builtin sprite cleanup at strength 35.
  3. Compare exact foreground RGBA values and true-green negative controls; the new focused pixel regression reproduces the loss on old source and passes after the repair.

Environment

  • Marinara Engine version: source staging a7688a071ca94459e93457d6e126678977acce7b for local investigation.
  • Install type: local source validation; the screenshot installation/cleanup engine is not confirmed.
  • OS + version: local macOS; exact screenshot server OS is not confirmed.
  • Browser or app shell: iPhone screenshots supplied by the maintainer; exact browser version is not confirmed.

Logs, screenshots, or video

The maintainer supplied paired Wardrobe/Home screenshots. Synthetic pixel fixtures confirm that old staging changes 245 of 1,872 foreground pixels while the repaired builtin changes 0; all 7,344 key-background pixels remain transparent. Proof: https://gist.github.com/SpicyMarinara/79f20cf85eca708adce8a976fba25d34. This does not claim the screenshot asset was replayed exactly.

Additional context

Implementation owner: @SpicyMarinara (Codex), isolated branch fix/preserve-cutout-feathers. Engine host PR: #8448. The optional revision-2 status/result metadata coordinates cache refresh with Pasta-Devs/Marinara-Agents#1849, which re-cleans the original source through builtin and retains the old visible derivative during refresh/failure.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @SpicyMarinara on GitHub (Oct 29, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8447 Originally assigned to: @SpicyMarinara on GitHub. ## Summary Builtin sprite background cleanup can misclassify blue/cyan foreground details as green spill, removing narrow feather ribbons or recoloring non-matte details near the cutout edge. ## Expected behavior Flat chroma backgrounds, enclosed matte pockets and true spill should be removed while opaque blue/gold foreground details remain intact. ## Actual behavior The shared builtin cleanup uses green minus the average of red/blue as a spill score. Pale blue RGB(120,200,230) scores as positive green spill even though blue is its strongest channel. The subsequent neighborhood/projection passes can reduce alpha or rewrite foreground colors. A user also reported missing blue/gold ribbons between an intact green-background Wardrobe image and its Home cutout in Otome Hearth. The screenshots alone do not identify the cleanup engine or prove the exact runtime cause. ## Steps to reproduce 1. Construct an opaque PNG with a flat green matte and thin blue/cyan/gold foreground ribbons. 2. Run the exported builtin sprite cleanup at strength 35. 3. Compare exact foreground RGBA values and true-green negative controls; the new focused pixel regression reproduces the loss on old source and passes after the repair. ## Environment - Marinara Engine version: source staging `a7688a071ca94459e93457d6e126678977acce7b` for local investigation. - Install type: local source validation; the screenshot installation/cleanup engine is not confirmed. - OS + version: local macOS; exact screenshot server OS is not confirmed. - Browser or app shell: iPhone screenshots supplied by the maintainer; exact browser version is not confirmed. ## Logs, screenshots, or video The maintainer supplied paired Wardrobe/Home screenshots. Synthetic pixel fixtures confirm that old staging changes 245 of 1,872 foreground pixels while the repaired builtin changes 0; all 7,344 key-background pixels remain transparent. Proof: https://gist.github.com/SpicyMarinara/79f20cf85eca708adce8a976fba25d34. This does not claim the screenshot asset was replayed exactly. ## Additional context Implementation owner: @SpicyMarinara (Codex), isolated branch `fix/preserve-cutout-feathers`. Engine host PR: #8448. The optional revision-2 status/result metadata coordinates cache refresh with Pasta-Devs/Marinara-Agents#1849, which re-cleans the original source through builtin and retains the old visible derivative during refresh/failure. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-11-07 16:42:26 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Oct 29, 2026):

Fixed in staging by #8448. The reviewed host changes are present at 387abb65c8. Post-merge pnpm check, sprite regressions and the combined Otome cleanup/gallery/persistence replay passed on that actual merged tree. Exact synthetic proof and the original-asset/provider/device limits are recorded in https://github.com/Pasta-Devs/Marinara-Engine/pull/8448#issuecomment-6494265042. Otome cache refresh is being delivered separately in Pasta-Devs/Marinara-Agents#1849.

<!-- gh-comment-id:6494282369 --> @SpicyMarinara commented on GitHub (Oct 29, 2026): Fixed in staging by #8448. The reviewed host changes are present at 387abb65c83f56b0c90ef7cd91930cfefb33617d. Post-merge pnpm check, sprite regressions and the combined Otome cleanup/gallery/persistence replay passed on that actual merged tree. Exact synthetic proof and the original-asset/provider/device limits are recorded in https://github.com/Pasta-Devs/Marinara-Engine/pull/8448#issuecomment-6494265042. Otome cache refresh is being delivered separately in Pasta-Devs/Marinara-Agents#1849.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#8356
No description provided.