{"id":51230465,"url":"https://github.com/sysadmindoc/alphacut","last_synced_at":"2026-06-30T22:00:34.477Z","repository":{"id":351460876,"uuid":"1169585905","full_name":"SysAdminDoc/AlphaCut","owner":"SysAdminDoc","description":"Video background removal \u0026 compositing.","archived":false,"fork":false,"pushed_at":"2026-06-28T14:45:51.000Z","size":145,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-28T16:11:18.512Z","etag":null,"topics":["background-removal","compositing","pyqt6","python","video"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SysAdminDoc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-28T22:45:46.000Z","updated_at":"2026-06-28T14:45:36.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/SysAdminDoc/AlphaCut","commit_stats":null,"previous_names":["sysadmindoc/alphacut"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/SysAdminDoc/AlphaCut","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SysAdminDoc%2FAlphaCut","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SysAdminDoc%2FAlphaCut/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SysAdminDoc%2FAlphaCut/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SysAdminDoc%2FAlphaCut/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SysAdminDoc","download_url":"https://codeload.github.com/SysAdminDoc/AlphaCut/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SysAdminDoc%2FAlphaCut/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34984784,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-30T02:00:05.919Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["background-removal","compositing","pyqt6","python","video"],"created_at":"2026-06-28T16:00:19.550Z","updated_at":"2026-06-30T22:00:34.443Z","avatar_url":"https://github.com/SysAdminDoc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AlphaCut v1.6.4\n\n**Video \u0026 image background removal + compositing.**\n\nAlphaCut uses ONNX segmentation models to isolate subjects from video and image backgrounds, with built-in compositing, mixed batch processing, quick previews, and detected hardware encoding.\n\n![Version](https://img.shields.io/badge/Version-v1.6.4-blue?style=flat-square)\n![Python](https://img.shields.io/badge/Python-3.9+-blue?style=flat-square\u0026logo=python)\n![License](https://img.shields.io/badge/License-MIT-green?style=flat-square)\n![Platform](https://img.shields.io/badge/Platform-Windows%20|%20Linux%20|%20macOS-blue?style=flat-square)\n\n---\n\n## Features\n\n**AI \u0026 Processing**\n- 10 AI Models — U2Net, ISNet, BiRefNet (6 variants) — from fast drafts to cinema-quality edges\n- 11 Software Output Formats — ProRes 4444+Alpha, WebM VP9+Alpha, H.264, HEVC, AV1, Animated WebP, Animated GIF, PNG sequences, green screen, grayscale matte, FG+Alpha pair\n- Hardware Encoder Options — detected NVENC/QSV H.264 and HEVC formats appear automatically when FFmpeg exposes them\n- Single \u0026 Batch Image Mode — drop one image or mixed image/video batches for transparent PNG export\n- Chroma-Key Fallback — auto-detect green/blue screens; FFmpeg chroma-key for 10x speed boost\n- Pipelined I/O — parallel decode/infer/save threads for higher throughput\n- Frame Skip — process every Nth frame with mask reuse (up to 10x speedup)\n- Benchmark Mode — test 10 samples to estimate total processing time\n- Memory Monitoring — live RAM % during processing with warnings\n- Resume Interrupted Jobs — progress saved every 50 frames, auto-resumes on restart\n- Pipe Mode — `--pipe` streams raw RGBA to stdout for FFmpeg/scriptable pipelines without blocking on FFmpeg diagnostics\n- Model Registry — `models.json` declares model name, URL, SHA-256 hash, input size, and license; downloads fail closed on mismatch\n\n**Advanced Compositing**\n- ROI Selection — crop AI inference to a preview-selected subject region\n- Manual Mask Painting — foreground/background brush corrections applied to preview, single export, and batch export\n- Mask Preview Modes — compare original/result, inspect binary masks, gray masks, and red/green overlays\n- Background Replacement — solid color (6 presets + custom picker) or image file\n- Color Spill Suppression — reduce green/blue/red spill along mask edges\n- Shadow Preservation — detect and keep ground shadows via luminance analysis\n- Mask Inversion — remove subject instead of background\n\n**Batch \u0026 Workflow**\n- Batch Queue — drop multiple videos, images, folders, or mixed sets and process sequentially\n- Job Table — per-file thumbnails, per-job model/format overrides, status, progress %, and output path\n- Thumbnail Grid — visual grid preview of all batch files before processing\n- Quick Preview — render a 10-second sample clip before committing to full processing\n- Drag-Out Export — drag output file directly into NLE timelines\n- CLI Mode — full argparse interface for headless/scripted operation (with auto chroma-key detection)\n- Auto-Naming — configurable output patterns ({name}, {model}, {format}, {date})\n- Export Presets — save/load all settings including compositing\n- Recent Files — last 20 files quick-access menu\n\n**UI/UX**\n- Before/After Split View with draggable divider\n- Smart Model Picker, Toast Notifications, Animated Progress\n- System Tray integration, Scrubable Preview\n- Menu Bar — File, Tools (Model Manager, Settings Folder), Help (Updates, About)\n- About Dialog — version, system info, GitHub links\n- Update Checker — checks GitHub releases on startup and on demand\n- Model Manager — view/delete cached ONNX models with size info\n- Settings Persistence — all preferences saved between sessions with failure logging\n- Localization Ready — expanded i18n coverage with `locale_template.json` for community translations\n\n## Requirements\n\n| Requirement | Details |\n|---|---|\n| **Python** | 3.9+ |\n| **FFmpeg** | On PATH |\n| **NVIDIA GPU** | Optional — CUDA 12 + cuDNN 9 |\n\n## Installation\n\nWindows releases include `AlphaCut-Setup-\u003cversion\u003e.exe`, an Inno Setup installer that installs AlphaCut per user and creates Start Menu shortcuts. The portable `AlphaCut-windows.exe` is still published for users who prefer a standalone executable.\n\n### Docker\n\n```bash\ndocker build -t alphacut .\ndocker run --rm -v $(pwd):/data alphacut -i /data/video.mp4 -f webm -o /data/output.webm\n```\n\nGPU-enabled Docker builds use the NVIDIA CUDA runtime and `onnxruntime-gpu`:\n\n```bash\ndocker build -f Dockerfile.gpu -t alphacut:gpu .\ndocker run --rm --gpus all -v $(pwd):/data alphacut:gpu -i /data/video.mp4 -f webm -o /data/output.webm --gpu-device 0\n```\n\n## Quick Start\n\n```bash\n# GUI\npython AlphaCut.py\n\n# CLI — single image (outputs transparent PNG)\npython AlphaCut.py -i photo.jpg -m BiRefNet\n\n# CLI — video\npython AlphaCut.py -i video.mp4 -f prores -m BiRefNet\n\n# CLI — background replacement\npython AlphaCut.py -i video.mp4 -f webm --bg-image beach.jpg\n\n# CLI — green spill + shadow preservation\npython AlphaCut.py -i greenscreen.mp4 -f prores --spill 60 --shadow 40\n\n# CLI — batch with frame skip\npython AlphaCut.py -i vid1.mp4 vid2.mp4 vid3.mp4 -f webm --frame-skip 3\n\n# CLI — batch images (outputs transparent PNG files)\npython AlphaCut.py -i photo1.jpg photo2.png photo3.webp -m BiRefNet -y\n\n# CLI — invert mask + custom background\npython AlphaCut.py -i video.mp4 -f prores --invert --bg-color 0,0,0\n\n# CLI — FG + Alpha pair (for NLEs without alpha support)\npython AlphaCut.py -i video.mp4 -f fg_alpha -m BiRefNet\n\n# CLI — pipe raw RGBA into FFmpeg\npython AlphaCut.py -i video.mp4 --pipe 2\u003enul | ffmpeg -f rawvideo -pix_fmt rgba -s 1920x1080 -r 30 -i - -c:v libvpx-vp9 out.webm\n```\n\n## CLI Reference\n\n| Flag | Default | Description |\n|---|---|---|\n| `-i`, `--input` | — | Input video/image file(s) |\n| `-o`, `--output` | Auto-named | Output path |\n| `-m`, `--model` | `u2net_human_seg` | Model name (partial match) |\n| `-f`, `--format` | `mp4` | mp4, hevc, av1, prores, webm, webp_anim, gif_anim, png_seq, greenscreen, matte, fg_alpha, mp4_nvenc, hevc_nvenc, mp4_qsv, hevc_qsv |\n| `--gpu-device` | -1 (auto) | GPU device index for inference |\n| `--fp16` | — | Use half-precision inference on GPU |\n| `--max-res` | 0 (original) | Max resolution |\n| `--edge` | 0 | Edge softness (0-100) |\n| `--shift` | 0 | Mask shift (-20 to +20) |\n| `--temporal` | 0 | Temporal smooth (0-7) |\n| `--frame-skip` | 1 | Process every Nth frame |\n| `--invert` | — | Invert mask |\n| `--spill` | 0 | Spill suppression (0-100) |\n| `--spill-color` | green | Spill color: green, blue, red |\n| `--shadow` | 0 | Shadow preservation (0-100) |\n| `--bg-color` | — | Background R,G,B |\n| `--bg-image` | — | Background image path |\n| `--no-audio` | — | Strip audio |\n| `-y`, `--overwrite` | — | Overwrite output without confirmation |\n| `--chroma-key` | — | Use FFmpeg chroma-key when a green/blue screen is detected |\n| `--pipe` | — | Stream raw RGBA to stdout for FFmpeg pipelines |\n| `--json` | — | Emit newline-delimited JSON progress/status/error events; failures exit non-zero and end with a `failed` event |\n\n## AI Models\n\n| Model | Speed | Quality | Best For |\n|---|---|---|---|\n| `u2netp` | Fast | Good | Quick previews |\n| `u2net_human_seg` | Fast | Great | **People (default)** |\n| `silueta` | Fast | Good | People (small) |\n| `u2net` | Medium | Great | General subjects |\n| `isnet-general-use` | Medium | Great | General subjects |\n| `isnet-anime` | Medium | Great | Anime / illustrations |\n| `BiRefNet-portrait` | Slow | Excellent | Portraits, hair detail |\n| `BiRefNet-general` | Slow | Excellent | **Best overall** |\n| `BiRefNet-general-lite` | Medium | Excellent | Fast + high quality |\n| `BiRefNet-matting` | Slow | Excellent | Hair and transparent edges |\n\n## Project Planning\n\n- `ROADMAP.md` - active and proposed work.\n- `Roadmap_Blocked.md` - items blocked by external dependencies or research.\n- `RESEARCH.md` - research notes that inform future roadmap candidates.\n\n## Architecture\n\n```\nAlphaCut.py (single file, ~4,850 lines)\n├── Crash Handler + Bootstrap (auto-installs all deps)\n├── AlphaCutEngine — ONNX inference + mask refinement\n│   ├── Edge refinement, temporal smoothing\n│   ├── Spill suppression, shadow preservation\n│   ├── Mask inversion, background compositing\n│   ├── SHA-256 model integrity verification\n│   └── Engine cache (singleton)\n├── ProcessingWorker — Pipelined frame processing\n│   ├── Reader thread → AI inference → Saver thread\n│   ├── Frame skip with mask reuse\n│   └── Resume from last saved frame\n├── BatchWorker — Sequential multi-file processing\n├── ImageProcessWorker — Single and batch image background removal\n├── BenchmarkWorker — 10-frame speed estimation\n├── PreviewFrameWorker — Single-frame preview\n├── QuickPreviewWorker — 10-second sample render workflow\n├── UpdateChecker — GitHub releases API\n├── AboutDialog — Version/system info\n├── ModelManagerDialog — Download/delete models\n├── SplitPreviewWidget — Before/after comparison\n│   └── ROI selection + manual mask paint overlays + mask viewer modes\n├── DragOutButton — Drag output file to NLE\n├── ThumbnailGrid — Visual batch file preview grid\n├── ToastWidget — Floating notifications\n├── CLI — Full argparse headless interface\n├── Pipe Mode — Raw RGBA stdout for FFmpeg pipelines\n├── i18n — _tr() scaffold + locale_template.json\n├── models.json — External model registry\n└── Settings/Presets — JSON persistence\n```\n\n## Local Build\n\n```bash\npyinstaller --onefile --windowed --runtime-hook packaging/pyinstaller_runtime_hook.py --collect-all onnxruntime --collect-submodules scipy AlphaCut.py\n\"C:\\Program Files (x86)\\Inno Setup 6\\ISCC.exe\" packaging\\windows\\AlphaCut.iss\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsysadmindoc%2Falphacut","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsysadmindoc%2Falphacut","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsysadmindoc%2Falphacut/lists"}