Files
nyuller/tools/apply_scanlines.py
T
mr.one f4b344cccd Implement NUFLI delta encoding with scanlines
- Add tools/apply_scanlines.py for CRT scanline effect
- Add tools/nufli_delta.py for delta encoding (base + bitmask deltas)
- Delta format: 2880 byte bitmask + N byte values per screen
- 40.1% size reduction vs raw NUFLI (69KB vs 115KB for 5 screens)
- Base (23KB) at 000-FFF, title delta (7KB) at -
- Other deltas use title as fallback (TODO: disk loading)
- Update tasks.md with scanline and delta encoding documentation
2026-07-19 00:12:37 +02:00

15 lines
411 B
Python

#!/usr/bin/env python3
"""Apply scanline effect: darken every odd row for CRT aesthetic."""
import sys
from PIL import Image
src, dst = sys.argv[1], sys.argv[2]
img = Image.open(src).resize((320, 200), Image.LANCZOS).convert('RGB')
px = img.load()
for y in range(200):
if y % 2 == 1:
for x in range(320):
r, g, b = px[x, y]
px[x, y] = (r // 4, g // 4, b // 4)
img.save(dst)