7 sys.stderr.write("usage: icom-gen INFILE OUTFILE\n")
9 inf = Image.open(sys.argv[1])
14 for y in xrange(tsz[1]):
16 for x in xrange(tsz[0]):
19 for y2 in xrange(y * sz[1] / tsz[1], (y + 1) * sz[1] / tsz[1]):
20 for x2 in xrange(x * sz[0] / tsz[0], (x + 1) * sz[0] / tsz[0]):
21 p = inf.getpixel((x2, y2))
27 line.append(tuple(sum))
30 f = open(sys.argv[2], "w")