brian smith overcomplicates things
print "stuff going down!"
import Image
import math
def mapImage(file):
image = Image.open(file)
maxx = image.size[0]
maxy = image.size[1]
print str(maxx) + ' ' + str(maxy)
#return
image = image.load()
imagef = Image.new('RGBA', (maxx + 1, maxy + 1), (0, 0, 0, 0))
imagf = imagef.load()
mod = 0
first = True
r = []
newx = 0
newy = 0
print str(image[0,0])
for x in range(maxx):
for y in range(maxy):
if first == True:
first = False
if math.floor((x / 16) + 0.5) * 16 == x:
if math.floor((y / 16) + 0.5) * 16 == y:
#print str(newx) + ' ' + str(newy)
print str(x) + ' ' + str(y)
imagf[newx,newy] = image[x,y]
#mod = 0
newx = newx + 1
newy = newy + 1
else:
if newx >= 5184:
break
if newy >= 5184:
break
#mod = mod + 1
imagef.save('image.png')
mapImage('map.png')
silly
import Image
data = {}
img = Image.open('dumb.png')
pix = img.load()
for x in range(image.size[0] / 16):
for y in range(image.size[1] / 16):
data[x, y] = pix[x * 16, y * 16]