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