feat: reduce build size — replace Pillow with cv2, refactor build scripts
All checks were successful
Build Release / create-release (push) Successful in 1s
Build Release / build-docker (push) Successful in 42s
Lint & Test / test (push) Successful in 2m50s
Build Release / build-windows (push) Successful in 3m27s
Build Release / build-linux (push) Successful in 1m59s

- Create utils/image_codec.py with cv2-based image helpers
- Replace PIL usage across all routes, filters, and engines with cv2
- Move Pillow from core deps to [tray] optional in pyproject.toml
- Extract shared build logic into build-common.sh (detect_version, cleanup, etc.)
- Strip unused NumPy/PIL/zeroconf/debug files in build scripts
This commit is contained in:
2026-03-25 14:18:16 +03:00
parent 7da5084337
commit 7939322a7f
18 changed files with 444 additions and 377 deletions

View File

@@ -28,7 +28,6 @@ dependencies = [
"httpx>=0.27.2",
"packaging>=23.0",
"mss>=9.0.2",
"Pillow>=10.4.0",
"numpy>=2.1.3",
"pydantic>=2.9.2",
"pydantic-settings>=2.6.0",
@@ -46,6 +45,7 @@ dependencies = [
"sounddevice>=0.5",
"aiomqtt>=2.0.0",
"openrgb-python>=0.2.15",
"opencv-python-headless>=4.8.0",
]
[project.optional-dependencies]
@@ -57,9 +57,11 @@ dev = [
"black>=24.0.0",
"ruff>=0.6.0",
"opencv-python-headless>=4.8.0",
"Pillow>=10.4.0",
]
camera = [
"opencv-python-headless>=4.8.0",
# opencv-python-headless is now a core dependency (used for image encoding)
# camera extra kept for backwards compatibility
]
# OS notification capture (winrt packages are ~2.5MB total vs winsdk's ~35MB)
notifications = [
@@ -78,6 +80,7 @@ perf = [
]
tray = [
"pystray>=0.19.0; sys_platform == 'win32'",
"Pillow>=10.4.0; sys_platform == 'win32'",
]
[project.urls]