Commits

Lars Yencken committed 746ea6b

Only import Image on demand.

Comments (0)

Files changed (1)

 from functools import partial
 from itertools import product
 import random
-import Image
 import math
 
 import numpy as np
             print >> sys.stderr, l
 
     def _dump_value_map(self):
+        import Image
         im = Image.new('L', (self.rows, self.cols))
         value = self.value
         value = 255 * (value > 0) * value / value.max()
             % self.turn_no))
 
     def _dump_frontier(self, frontier):
+        import Image
         im = Image.new('RGB', (self.rows, self.cols))
         seen = self.seen
         for i, j in product(xrange(self.rows), xrange(self.cols)):
             % self.turn_no))
 
 def dump_grayscale_image(m, filename):
+    import Image
     rows, cols = m.shape
     im = Image.new('1', (cols, rows))
     for y, x in zip(*np.nonzero(m)):