[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-83166":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":8,"htmlUrl":8,"language":9,"languages":8,"totalLinesOfCode":8,"stars":10,"forks":11,"watchers":12,"openIssues":13,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":14,"stars7d":15,"stars30d":15,"stars90d":14,"forks30d":14,"starsTrendScore":16,"compositeScore":17,"rankGlobal":8,"rankLanguage":8,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":8,"pushedAt":8,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":14,"starSnapshotCount":14,"syncStatus":16,"lastSyncTime":26,"discoverSource":27},83166,"sprite-lab","boona13\u002Fsprite-lab","boona13",null,"TypeScript",78,7,59,1,0,19,2,2.71,"MIT License",false,"main",true,[],"2026-06-12 02:04:31","# Sprite Lab\n\n**Remove backgrounds and slice spritesheets** — entirely in your browser. Nothing is uploaded to a server, no AI models, no downloads.\n\nSprite Lab detects the backdrop of an image (magenta, green screen, checkerboard, or solid), removes it with a multi-pass alpha-matting pipeline that eliminates edge halos, then slices a spritesheet into individual frames by scanning connected pixels.\n\n---\n\n## Screenshots\n\nSlicing a character animation sheet — 24 frames detected automatically, with a live animation preview:\n\n![Slicing a character spritesheet](docs\u002Fslice-character.png)\n\nSlicing a dense item\u002Fprops atlas — 48 frames detected from a single sheet:\n\n![Slicing a props atlas](docs\u002Fslice-props.png)\n\n---\n\n## Features\n\n### Remove background\n- **Automatic** — detects checkerboard, green screen, magenta, or solid backdrops and removes them\n- **Multi-pass alpha matting** — recovers true edge coverage and decontaminates background spill, so there are no white\u002Fgrey halos around sprites\n- Before \u002F after preview on a transparency checkerboard\n- Download as PNG\n\n### Slice spritesheet\n- **Pixel-based frame detection** — finds each sprite by scanning connected pixels, never blind grid slicing\n- Background removed automatically when detected\n- Animation preview with adjustable FPS\n- Click frames to exclude them from export\n- **ZIP export** with individual frames, a recomposed horizontal strip, and `manifest.json`\n\n### 100% local\n- Pure pixel processing via the Canvas API — no machine-learning models, no network calls\n- Fully deterministic: the same input always produces the same output\n- Works offline\n\n---\n\n## Quick start\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fboona13\u002Fsprite-lab.git\ncd sprite-lab\nnpm install\nnpm run dev\n```\n\nOpen the local URL printed by Vite (e.g. **http:\u002F\u002Flocalhost:5173**).\n\n### Production build\n\n```bash\nnpm run build\nnpm run preview\n```\n\nDeploy the `dist\u002F` folder to any static host (GitHub Pages, Netlify, Vercel, etc.). No backend required.\n\n---\n\n## How it works\n\n1. **Backdrop detection** samples the image borders and color distribution to classify the background (`magenta`, `green`, `checkerboard`, `solid`, `transparent`, or `none`).\n2. **Removal** is routed by type — chroma key for magenta\u002Fgreen, border flood-fill for solid\u002Fwhite, and a checkerboard matte for transparency previews.\n3. **Multi-pass alpha matte** treats each silhouette pixel as a blend `C = α·F + (1−α)·B`, estimates the local foreground `F` and background `B`, solves for coverage `α`, and decontaminates the color. It iterates inward, peeling one ring of halo per pass until it reaches true sprite color.\n4. **Frame extraction** builds an alpha mask, finds connected components, and crops each to its own padded frame.\n\nThe full pipeline is shared between the browser app and a set of headless CLI tests:\n\n```bash\nnpm run test:pipeline -- path\u002Fto\u002Fspritesheet.png   # end-to-end, writes frames to disk\nnpm run test:checkerboard                           # checkerboard + drop-shadow case\nnpm run test:halo                                   # light-halo matte case\n```\n\n---\n\n## Export manifest\n\nThe ZIP includes a `manifest.json` describing every frame:\n\n```json\n{\n  \"version\": 1,\n  \"frameCount\": 24,\n  \"fps\": 12,\n  \"loop\": true,\n  \"strip\": { \"fileName\": \"strip.png\", \"sheetWidth\": 4096, \"sheetHeight\": 512 },\n  \"frames\": [\n    { \"index\": 0, \"fileName\": \"frame_01.png\", \"width\": 170, \"height\": 200, \"sourceX\": 12, \"sourceY\": 8, \"stripX\": 0 }\n  ]\n}\n```\n\n---\n\n## Tech stack\n\n| Layer | Technology |\n|-------|------------|\n| UI | Vite, TypeScript, CSS |\n| Image processing | HTML Canvas (client-side) |\n| Frame export | JSZip |\n| CLI tests | tsx, sharp |\n\n---\n\n## License\n\n[MIT](LICENSE)\n","Sprite Lab 是一个用于移除图像背景和切割精灵图的工具，完全在浏览器中运行。其核心功能包括自动检测并移除背景（如纯色、绿幕或棋盘格），通过多通道alpha抠图技术消除边缘光晕，并智能分割精灵图到单个帧。此外，它还支持动画预览、帧排除及ZIP格式导出。该工具基于Canvas API进行像素级处理，无需上传数据至服务器或依赖AI模型，确保了操作的本地化与确定性。非常适合游戏开发者或设计师在离线环境中对角色动画或道具图集进行高效处理。","2026-06-11 04:10:20","CREATED_QUERY"]