# Build Size Reduction ## Phase 1: Quick Wins (build scripts) - [x] Strip unused NumPy submodules (polynomial, linalg, ma, lib, distutils) - [x] Strip debug symbols from .pyd/.dll/.so files - [x] Remove zeroconf service database - [x] Remove .py source from site-packages after compiling to .pyc - [x] Strip unused PIL image plugins (keep JPEG/PNG/ICO/BMP for tray) ## Phase 2: Replace Pillow with cv2 - [x] Create `utils/image_codec.py` with cv2-based image helpers - [x] Replace PIL in `_preview_helpers.py` - [x] Replace PIL in `picture_sources.py` - [x] Replace PIL in `color_strip_sources.py` - [x] Replace PIL in `templates.py` - [x] Replace PIL in `postprocessing.py` - [x] Replace PIL in `output_targets_keycolors.py` - [x] Replace PIL in `kc_target_processor.py` - [x] Replace PIL in `pixelate.py` filter - [x] Replace PIL in `downscaler.py` filter - [x] Replace PIL in `scrcpy_engine.py` - [x] Replace PIL in `live_stream_manager.py` - [x] Move Pillow from core deps to [tray] optional in pyproject.toml - [x] Make PIL import conditional in `tray.py` - [x] Move opencv-python-headless to core dependencies ## Phase 4: OpenCV stripping (build scripts) - [x] Strip ffmpeg DLL, Haar cascades, dev files (already existed) - [x] Strip typing stubs (already existed) ## Verification - [x] Lint: `ruff check src/ tests/ --fix` - [x] Tests: 341 passed