[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-75473":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":12,"contributorsCount":12,"subscribersCount":12,"size":12,"stars1d":12,"stars7d":12,"stars30d":14,"stars90d":12,"forks30d":12,"starsTrendScore":12,"compositeScore":15,"rankGlobal":9,"rankLanguage":9,"license":16,"archived":17,"fork":17,"defaultBranch":18,"hasWiki":19,"hasPages":17,"topics":20,"createdAt":9,"pushedAt":9,"updatedAt":21,"readmeContent":22,"aiSummary":23,"trendingCount":12,"starSnapshotCount":12,"syncStatus":24,"lastSyncTime":25,"discoverSource":26},75473,"image-multi-asset-extractor","3440869867\u002Fimage-multi-asset-extractor","3440869867","Automatically split multi-object asset sheets into individual transparent PNG assets with background removal and manifest generation.",null,"Python",107,0,64,43,44.3,"MIT License",false,"main",true,[],"2026-06-12 04:01:18","# Image Multi Asset Extractor\n\nImage Multi Asset Extractor is a standalone Python tool for splitting 2.5D\u002Fisometric sprite-sheet images into individual transparent PNG assets.\n\nIt is useful for map asset libraries, worldbuilding tools, tabletop map editors, visual novel tools, and game prototypes.\n\n> GPU acceleration is NVIDIA CUDA only. AMD GPU acceleration is not supported.\n\n## What It Does\n\n- Reads PNG, JPG, JPEG, and WEBP sprite sheets.\n- Detects multiple independent visual elements in one sheet.\n- Ignores likely headers, labels, numbering, text notes, and large borders.\n- Crops each detected element with 24-48px padding.\n- Removes background with `rembg`.\n- Exports transparent PNG files.\n- Generates a map-asset manifest JSON.\n- Sends uncertain sheets to `review_needed\u002F` without deleting originals.\n- Supports named extraction presets.\n- Supports dry-run detection previews before exporting PNG files.\n- Generates a human-readable HTML report.\n- Provides both CLI and optional Gradio Web UI.\n\n## Repository Layout\n\n```text\nimage-multi-asset-extractor\u002F\n├── input_sheets\u002F\n├── cropped\u002F\n├── output_png\u002F\n├── review_needed\u002F\n├── manifest\u002F\n├── reports\u002F\n├── docs\u002F\n├── examples\u002F\n├── app.py\n├── config.json\n├── extract_assets.py\n├── requirements.txt\n├── requirements-gpu-nvidia.txt\n├── requirements-ui.txt\n├── pyproject.toml\n└── README.md\n```\n\n## Hardware Requirement\n\nThe tool supports most common systems through CPU mode, supports faster background removal on NVIDIA CUDA systems, and provides best-effort AMD acceleration through DirectML or ROCm.\n\nRecommended production GPU mode:\n\n- NVIDIA GPU\n- Recent NVIDIA driver\n- CUDA-compatible runtime through `onnxruntime-gpu`\n\nBest-effort AMD modes:\n\n- Windows AMD: DirectML through `DmlExecutionProvider`\n- Linux AMD: ROCm through `ROCMExecutionProvider`\n\nNot supported:\n\n- Intel GPU acceleration\n- macOS GPU acceleration\n\nCPU-only testing can be allowed with `--allow-cpu`, but it is slower and intended for small inputs or debugging.\n\nSee:\n\n- [docs\u002FINSTALL.md](docs\u002FINSTALL.md)\n- [docs\u002FNVIDIA_CUDA.md](docs\u002FNVIDIA_CUDA.md)\n- [docs\u002FGPU_BACKENDS.md](docs\u002FGPU_BACKENDS.md)\n\n## System Support\n\n| System | CPU Mode | NVIDIA GPU Mode | AMD GPU Mode |\n| --- | --- | --- | --- |\n| Windows 10\u002F11 | Yes | Yes | Best effort via DirectML |\n| Linux x86_64 | Yes | Yes | Best effort via ROCm |\n| macOS Apple Silicon | Yes | No | No |\n| macOS Intel | Yes | Not recommended | No |\n| Docker | Yes | Advanced setup | Not included |\n\n## Installation\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fyour-name\u002Fimage-multi-asset-extractor.git\ncd image-multi-asset-extractor\n\npython -m venv .venv\n.venv\\Scripts\\activate\n\npip install -r requirements.txt\npip install -r requirements-cpu.txt\n```\n\nNVIDIA install:\n\n```bash\npip install -r requirements.txt\npip install -r requirements-gpu-nvidia.txt\n```\n\nAMD Windows DirectML install:\n\n```bash\npip install -r requirements.txt\npip install -r requirements-amd-directml.txt\n```\n\nAMD Linux ROCm install:\n\n```bash\npip install -r requirements.txt\npip install -r requirements-amd-rocm.txt\n```\n\nOptional Web UI:\n\n```bash\npip install -r requirements-ui.txt\n```\n\nOr use helper scripts:\n\n```powershell\n.\\scripts\\install_cpu.ps1\n.\\scripts\\install_nvidia.ps1\n.\\scripts\\install_amd_directml.ps1\n.\\scripts\\run_ui.ps1\n```\n\nLinux\u002FmacOS:\n\n```bash\nchmod +x scripts\u002F*.sh\n.\u002Fscripts\u002Finstall_cpu.sh\n.\u002Fscripts\u002Finstall_amd_rocm.sh\n.\u002Fscripts\u002Frun_ui.sh\n```\n\nDocker CPU mode:\n\n```bash\ndocker compose up --build\n```\n\nCheck environment:\n\n```bash\npython extract_assets.py --check-env\n```\n\n## Quick Start\n\n1. Put sprite-sheet images into:\n\n```text\ninput_sheets\u002F\n```\n\n2. Edit `config.json`:\n\n```json\n{\n  \"category\": \"roads-waterways\",\n  \"prefix\": \"river\",\n  \"padding\": 36,\n  \"minArea\": 8000,\n  \"maxArea\": 1200000,\n  \"removeBackground\": true,\n  \"outputSize\": 512,\n  \"ignoreTextRegions\": true,\n  \"gpuBackend\": \"auto\",\n  \"requireNvidiaGpu\": false,\n  \"allowCpuFallback\": true,\n  \"commercialSafe\": true,\n  \"tags\": [\"2.5d\", \"isometric\", \"map\", \"river\"]\n}\n```\n\n3. Run:\n\n```bash\npython extract_assets.py\n```\n\nCPU-only testing:\n\n```bash\npython extract_assets.py --allow-cpu\n```\n\nPreview detection boxes without exporting PNGs:\n\n```bash\npython extract_assets.py --dry-run --allow-cpu\n```\n\nThis writes annotated preview images and an HTML report to:\n\n```text\nreports\u002Fextraction_report.html\n```\n\nOverride category and filename prefix:\n\n```bash\npython extract_assets.py --category roads-waterways --prefix river\n```\n\nList built-in presets:\n\n```bash\npython extract_assets.py --list-presets\n```\n\nUse a preset:\n\n```bash\npython extract_assets.py --preset xianxia-buildings\n```\n\n## Web UI\n\nStart the UI:\n\n```bash\npython app.py\n```\n\nThe UI supports:\n\n- Multiple sheet uploads.\n- Category and prefix editing.\n- Preset selection.\n- Padding and area threshold tuning.\n- Preview-only dry run mode.\n- NVIDIA environment check.\n- CPU fallback toggle for testing.\n- Output PNG preview.\n- Manifest preview.\n- HTML report path.\n\n## Output\n\nTransparent PNG assets are written to:\n\n```text\noutput_png\u002F\n```\n\nIntermediate crops are written to:\n\n```text\ncropped\u002F\n```\n\nSheets that need manual inspection are copied to:\n\n```text\nreview_needed\u002F\n```\n\nThe manifest is written to:\n\n```text\nmanifest\u002Fmap_assets.generated.json\n```\n\nThe HTML report is written to:\n\n```text\nreports\u002Fextraction_report.html\n```\n\n## Filename Format\n\n```text\nriver_001.png\nriver_002.png\nriver_003.png\n```\n\nThe prefix comes from `config.json`.\n\n## Manifest Format\n\nEach generated item looks like:\n\n```json\n{\n  \"id\": \"river_001\",\n  \"name\": \"River 001\",\n  \"category\": \"roads-waterways\",\n  \"subCategory\": \"river\",\n  \"spriteUrl\": \"\u002Fassets\u002Fmap\u002Fisometric\u002Froads-waterways\u002Friver_001.png\",\n  \"thumbnail\": \"\u002Fassets\u002Fmap\u002Fisometric\u002Froads-waterways\u002Friver_001.png\",\n  \"defaultWidth\": 512,\n  \"defaultHeight\": 512,\n  \"anchorX\": 0.5,\n  \"anchorY\": 0.8,\n  \"tags\": [\"2.5d\", \"isometric\", \"map\", \"river\"],\n  \"licenseStatus\": \"ai-generated\",\n  \"commercialSafe\": true\n}\n```\n\n## Suggested Categories\n\n- `river`\n- `ocean`\n- `road`\n- `bridge`\n- `building`\n- `war`\n- `xianxia`\n- `sci-fi`\n\n## Presets\n\nPresets live in:\n\n```text\npresets.json\n```\n\nCurrent presets:\n\n- `roads-waterways`\n- `xianxia-buildings`\n- `sci-fi-structures`\n- `war-markers`\n\nPresets are simple JSON fragments. They can tune:\n\n- `category`\n- `prefix`\n- `padding`\n- `minArea`\n- `maxArea`\n- `outputSize`\n- `tags`\n\nYou can also use broader categories such as:\n\n- `roads-waterways`\n- `terrain`\n- `settlements`\n- `landmarks`\n- `fantasy`\n- `modern`\n- `sci-fi`\n\n## Importing Into a Map Asset Library\n\nExample target:\n\n```text\npublic\u002Fassets\u002Fmap\u002Fisometric\u002Froads-waterways\u002F\n```\n\nCopy:\n\n```text\noutput_png\u002F*.png\n```\n\nThen merge:\n\n```text\nmanifest\u002Fmap_assets.generated.json\n```\n\ninto your application's map asset manifest.\n\n## Review Workflow\n\nAutomatic extraction is not perfect. Review `review_needed\u002F` when:\n\n- Elements are touching each other.\n- Text overlaps the artwork.\n- Background is complex.\n- Shadows are faint.\n- Borders are mistaken for assets.\n\nTune:\n\n- `minArea`\n- `maxArea`\n- `backgroundTolerance`\n- `padding`\n- `ignoreTextRegions`\n\n## Safety and Licensing\n\nThis tool does not determine whether a source image is legally safe to use. Only process assets you own, generated assets you are allowed to use, or assets with a license compatible with your project.\n\n`commercialSafe` is metadata you control. It is not legal advice.\n\n## Publishing to GitHub\n\nBefore publishing:\n\n1. Remove private images from `input_sheets\u002F`.\n2. Remove generated assets from `output_png\u002F`, `cropped\u002F`, `review_needed\u002F`, and `manifest\u002F`.\n3. Remove generated reports from `reports\u002F`.\n4. Keep only `.gitkeep` files in generated folders.\n5. Do not commit `.venv\u002F`.\n6. Run:\n\n```bash\npython -m py_compile extract_assets.py app.py\npython extract_assets.py --check-env\n```\n\nThen:\n\n```bash\ngit init\ngit add .\ngit commit -m \"Initial release\"\ngit branch -M main\ngit remote add origin https:\u002F\u002Fgithub.com\u002Fyour-name\u002Fimage-multi-asset-extractor.git\ngit push -u origin main\n```\n\n## Roadmap\n\n- Manual crop correction UI.\n- Side-by-side before\u002Fafter review mode.\n- Batch category presets.\n- Better detection for touching objects.\n- Optional SAM-based segmentation.\n- Export profiles for map editors and asset managers.\n","Image Multi Asset Extractor 是一个用于将2.5D\u002F等距视角的精灵图分割成独立透明PNG资源的Python工具。它能够读取PNG、JPG、JPEG和WEBP格式的精灵图，自动检测并裁剪出每个独立视觉元素，同时去除背景，并生成透明PNG文件及JSON格式的资源清单。此外，该工具还提供了不确定图片的人工审核功能，支持命名提取预设，以及在导出前进行干运行预览等功能。适用于地图资产库、世界构建工具、桌面地图编辑器、视觉小说工具和游戏原型开发等场景。项目支持NVIDIA CUDA加速以提高处理速度，同时也为AMD GPU提供基于DirectML或ROCm的最佳努力支持。",2,"2026-05-18 11:11:37","CREATED_QUERY"]