Skip to content

Sprite tool: drop sky stuck to the subject, build the sprite in a worker - #38

Merged
Finesssee merged 1 commit into
mainfrom
ts/autosprite-2
Oct 14, 2026
Merged

Finesssee merged 1 commit into
mainfrom
ts/autosprite-2

Conversation

@Finesssee

Copy link
Copy Markdown
Collaborator

Viewers who turn a photo into a sprite get two fixes.

  • Sky stuck to the subject. A cloud touching the top or side edge, and matching patches cut off beside the head, stayed in the sprite (the lake duck). dropEdgeLeak in src/autosprite.ts removes them. It backs off when that would remove more than 35% of the subject, so a duck on ice keeps its ice. Bench masks on the 9 test pictures match the approved run.
  • Page freeze. Building the sprite froze the fighter page for 0.3 to 1.3 s. It now runs in a Web Worker (src/sprite-worker.ts); a newer build replaces an older one. CSP needs no change (script-src 'self' covers a same-origin worker).

Tests: a unit test for the leak removal in tests/spritify.test.ts (red with either pass disabled). bun run check 392 of 392, tests/ui.ts and tests/arena-browser.ts pass locally. Docs: docs/CONTRACTS.md viewer sprites.

The subject cut could keep a cloud that touches the top or side edge, plus
look-alike patches beside the head. dropEdgeLeak removes them unless that
would take more than 35% of the subject.

Building the sprite froze the page for up to a second; it now runs in a
Web Worker and only the latest build is shown.
@coderabbitai

coderabbitai Bot commented Oct 14, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: nesszer/pixfray/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 083bca32-87a3-4234-bc7e-f223d3fe3bfe
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Finesssee
Finesssee merged commit 3a6c673 into main Oct 14, 2026
3 checks passed
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