[PR #7841] [CLOSED] fix(avatars): keep generated blink and talk pictures free of white edges #7962

Closed
opened 2026-10-24 04:09:11 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7841
Author: @SpicyMarinara
Created: 10/19/2026
Status: ❌ Closed

Base: staging ← Head: fix/avatar-variant-white-edges


📝 Commits (3)

  • eb567a0 chore: start 2D avatar variant edge investigation (#7840)
  • 70d5eb1 Merge branch 'staging' into fix/avatar-variant-white-edges
  • d2fb780 fix(avatars): preserve source colour at generated variant edges (#7840)

📊 Changes

2 files changed (+77 additions, -6 deletions)

View changed files

📝 packages/server/src/services/avatars/generation/generation-context.ts (+6 -6)
📝 scripts/regressions/avatar-backgrounds.regression.ts (+71 -0)

📄 Description

Linked issue

Closes #7840.

Why this change

Generated blink and talk pictures can show a white hair fringe and bottom stripe absent from their source sprite. The source-outline protection covered only four pixels at the reported image size, and did not recognize an opaque bust touching the canvas bottom as an edge.

What changed

  • Preserve the source's colour and alpha in a scale-dependent outline collar, including the canvas boundary. At 512 pixels the collar is 13 pixels, covering the observed near-contour fringe; facial edits farther inside remain the generated picture.
  • Add deterministic pixel regressions for an inward white fringe, bottom stripe, white hair, white teeth, closed eyes and a small cropped face. Existing cases continue to cover opaque sources and saving drafts without processing them twice.

This is an Engine host image-pipeline fix. Existing saved images and pending old drafts are not rewritten: regenerate an affected blink/talk picture after updating.

Validation

Completed local evidence:

  • pnpm install --frozen-lockfile --prefer-offline using the existing store: passed.
  • node scripts/run-regressions.mjs --filter scripts/regressions/avatar-backgrounds.regression.ts: 1/1 passed. The new bottom and fringe assertions each failed against the previous implementation before the corresponding fix.
  • node scripts/run-regressions.mjs --filter scripts/regressions/avatar-generation.regression.ts: 1/1 passed.
  • Read-only inspection retrieved the exact 512×484 transparent source. A clearly labeled synthetic-provider replay on that source reduced 2,171 corrupted near-outline pixels and 1,935 bottom-row pixels to zero, preserved every alpha byte, and retained generated eye, teeth and interior white-hair edits plus the original bowtie. The source file stayed byte-identical.

pnpm check passed before the staging security merge was added to this branch. A final exact-head recheck, browser and container validation, and local CodeRabbit review are still in progress; this PR remains draft until those local gates complete.

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Manually regenerate blink and talk pictures with the original provider, then compare them with their source face on dark and light backgrounds.
  • Manually verify the eyes and mouth edits remain visible and the face stays aligned when switching frames.
  • The unsaved generated phone draft was unavailable; the replay uses synthetic provider corruption calibrated to the screenshot, not the original provider output. No paid generation request or production write was made.

Docs and release impact

This repairs existing behavior without changing settings or installation. No guide or release metadata changes are needed.

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

Private local before/after comparison was visually reviewed against the actual source; the original source is not committed or published. The committed regression fixture is synthetic. This replay demonstrates removal within the protected contour collar, not every possible provider repaint outside it.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/7841 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/19/2026 **Status:** ❌ Closed **Base:** `staging` ← **Head:** `fix/avatar-variant-white-edges` --- ### 📝 Commits (3) - [`eb567a0`](https://github.com/Pasta-Devs/Marinara-Engine/commit/eb567a0c678bfc265a3b35d43ad03295417706f7) chore: start 2D avatar variant edge investigation (#7840) - [`70d5eb1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/70d5eb17a24cc20f85c30747222868f2d1e41418) Merge branch 'staging' into fix/avatar-variant-white-edges - [`d2fb780`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d2fb7802e99986490aad2cd918d23c5165423cf6) fix(avatars): preserve source colour at generated variant edges (#7840) ### 📊 Changes **2 files changed** (+77 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/services/avatars/generation/generation-context.ts` (+6 -6) 📝 `scripts/regressions/avatar-backgrounds.regression.ts` (+71 -0) </details> ### 📄 Description ## Linked issue Closes #7840. ## Why this change Generated blink and talk pictures can show a white hair fringe and bottom stripe absent from their source sprite. The source-outline protection covered only four pixels at the reported image size, and did not recognize an opaque bust touching the canvas bottom as an edge. ## What changed - Preserve the source's colour and alpha in a scale-dependent outline collar, including the canvas boundary. At 512 pixels the collar is 13 pixels, covering the observed near-contour fringe; facial edits farther inside remain the generated picture. - Add deterministic pixel regressions for an inward white fringe, bottom stripe, white hair, white teeth, closed eyes and a small cropped face. Existing cases continue to cover opaque sources and saving drafts without processing them twice. This is an Engine host image-pipeline fix. Existing saved images and pending old drafts are not rewritten: regenerate an affected blink/talk picture after updating. ## Validation Completed local evidence: - `pnpm install --frozen-lockfile --prefer-offline` using the existing store: passed. - `node scripts/run-regressions.mjs --filter scripts/regressions/avatar-backgrounds.regression.ts`: 1/1 passed. The new bottom and fringe assertions each failed against the previous implementation before the corresponding fix. - `node scripts/run-regressions.mjs --filter scripts/regressions/avatar-generation.regression.ts`: 1/1 passed. - Read-only inspection retrieved the exact 512×484 transparent source. A clearly labeled synthetic-provider replay on that source reduced 2,171 corrupted near-outline pixels and 1,935 bottom-row pixels to zero, preserved every alpha byte, and retained generated eye, teeth and interior white-hair edits plus the original bowtie. The source file stayed byte-identical. `pnpm check` passed before the staging security merge was added to this branch. A final exact-head recheck, browser and container validation, and local CodeRabbit review are still in progress; this PR remains draft until those local gates complete. - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes - Manually regenerate blink and talk pictures with the original provider, then compare them with their source face on dark and light backgrounds. - Manually verify the eyes and mouth edits remain visible and the face stays aligned when switching frames. - The unsaved generated phone draft was unavailable; the replay uses synthetic provider corruption calibrated to the screenshot, not the original provider output. No paid generation request or production write was made. ## Docs and release impact This repairs existing behavior without changing settings or installation. No guide or release metadata changes are needed. - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) Private local before/after comparison was visually reviewed against the actual source; the original source is not committed or published. The committed regression fixture is synthetic. This replay demonstrates removal within the protected contour collar, not every possible provider repaint outside it. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:09:11 +07:00
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#7962
No description provided.