import numpy as np
_spritedata = [*[0] * 8, *[0, 0, 0, 1, 1, 0, 0, 0] * 2, *[0, 1, 1, 0, 0, 1, 1, 0] * 2, *[0, 0, 0, 1, 1, 0, 0, 0] * 2, *[0]*8]

print(len(_spritedata))

spritedata = np.array(_spritedata).reshape(len(_spritedata)//2, 2)

data = []

for row in spritedata:
    byte = row[0] << 4 | row[1]
    print(f"Pixels {row} turn into byte: {byte:x}")
    data.append(byte)

print(len(data))

with open('sprite1.data', 'wb') as f:
    f.write(bytes(data))
