else/ascii/individual/developchart.py

17 lines
351 B
Python
Raw Normal View History

2014-12-01 10:19:13 +00:00
import imageaverage
from PIL import Image
def develop():
out = open('t.txt', 'w')
image = Image.open('asciichars.png')
c = 0
for x in range(96):
x *= 15
chunk = image.crop((0, x, 9, x+14))
av = imageaverage.average(chunk)
c += 1
chunk.save("individual\\%d_%d.png" % (c, av[3]))
print(av[3], file=out)
print(c)
out.close()
develop()