1
0
mirror of https://github.com/osmarks/random-stuff synced 2025-12-17 19:38:05 +00:00

add CC projects

This commit is contained in:
2023-11-13 19:37:05 +00:00
parent 94b4db7549
commit a507315ad2
114 changed files with 11478 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
import json
from PIL import Image
import os
def chunks(x, l):
return [ x[i:i+l] for i in range(0, len(x), l) ]
ls = []
for f in os.listdir("cc-tiles"):
if "fs8" in f:
im = Image.open(os.path.join("cc-tiles", f))
ls.append(([ int(b.hex().rjust(6, "0"), 16) for b in chunks(im.palette.getdata()[1], 3) ], list(im.getdata())))
print(json.dumps(ls).replace("[", "{").replace("]", "}"))