Created
March 18, 2018 17:30
-
-
Save akrasuski1/1e3e04ed43a0972abae4a9d9988e6ffd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
import sys | |
datas = [] | |
for name in range(3): | |
im = Image.open("imgs/img-%d.png" % name) | |
data = im.getdata() | |
bits = [] | |
for i in range(26): | |
for j in range(16): | |
bits.append(data[64*64*16*i+64*j]/255) | |
bytes = [] | |
for i in range(26*2): | |
c = 0 | |
for j in range(8): | |
c *= 2 | |
c += bits[i*8+j] | |
bytes.append(c) | |
datas.append(bytes) | |
for d in datas: | |
print d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment