Clean master

This commit is contained in:
Shadow15510 2021-06-02 22:16:40 +02:00
parent bb26b69d99
commit 383a0c1254
5 changed files with 0 additions and 39 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

View File

@ -1,39 +0,0 @@
from PIL import Image
import numpy as np
def analyse(index, pxl):
if pxl[0] == 255: return 0
else:
if index < 18 or index > 52: return 1
if 24 < index < 40: return 3
else: return 2
def show():
img = Image.open("world.png")
data = np.array(img)
rslt = ""
for index, line in enumerate(data):
for pxl in line:
rslt += f"{analyse(index, pxl)}"
rslt += "\n"
print(rslt)
def get_tabular():
img = Image.open("world.png")
data = np.array(img)
rslt = "const unsigned int world[64][128] =\n{"
for index, line in enumerate(data):
rslt += "\n {"
for pxl in line:
rslt += f"{analyse(index, pxl)}, "
rslt = rslt[:-2] + "},"
rslt += "\n};"
print(rslt)
get_tabular()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB