aboutsummaryrefslogtreecommitdiff
path: root/experiments/conv
diff options
context:
space:
mode:
Diffstat (limited to 'experiments/conv')
-rw-r--r--experiments/conv/makefile5
-rwxr-xr-xexperiments/conv/png2pc7
2 files changed, 10 insertions, 2 deletions
diff --git a/experiments/conv/makefile b/experiments/conv/makefile
index ae2f70d..2a513c0 100644
--- a/experiments/conv/makefile
+++ b/experiments/conv/makefile
@@ -1,5 +1,8 @@
%.png: %.bin
- ./pc2png $<
+ venv/bin/python3 pc2png $<
+
+%.bin: %.png
+ venv/bin/python3 png2pc $<
%.h: %.bin
./bin2h $< > $@
diff --git a/experiments/conv/png2pc b/experiments/conv/png2pc
index d1eaab8..21b3b29 100755
--- a/experiments/conv/png2pc
+++ b/experiments/conv/png2pc
@@ -1,7 +1,7 @@
#!/bin/python3
import itertools
import io
-from PIL import Image
+from PIL import Image, ImageDraw
from consts import *
from shared import main
@@ -37,6 +37,11 @@ def png2pc(data):
img = img.convert('RGB')
img = img.quantize(palette=palette_img)
+ draw = ImageDraw.Draw(img)
+ draw.rectangle(((0, 0), (24, img.height)), fill=0)
+ draw.rectangle(((252, 0), (256, img.height)), fill=0)
+ draw.rectangle(((24, 0), (79, 16)), fill=0)
+
output = b""
for tile_idx in range(tile_count):
tile = (