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
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
#!/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)
|
||||
Reference in New Issue
Block a user