Exemple #1
0
 def drawer(image, text):
     width, height = image.size
     dx = width / 10
     width = width - dx
     dy = height / 10
     height = height - dy
     draw = Draw(image)
     for i in xrange(number):
         x = int(random.uniform(dx, width))
         y = int(random.uniform(dy, height))
         draw.line(((x, y), (x + level, y)), fill=color(), width=level)
     return image
Exemple #2
0
 def drawer(image, text):
     width, height = image.size
     dx = width / 10
     width = width - dx
     dy = height / 10
     height = height - dy
     draw = Draw(image)
     for i in xrange(number):
         x = int(random.uniform(dx, width))
         y = int(random.uniform(dy, height))
         draw.line(((x, y), (x + level, y)), fill=color(), width=level)
     return image
Exemple #3
0
 def drawer(image, text):
     dx, height = image.size
     dx = dx / number
     path = [(dx * i, random.randint(0, height))
             for i in range(1, number)]
     bcoefs = make_bezier(number - 1)
     points = []
     for coefs in bcoefs:
         points.append(tuple(sum([coef * p for coef, p in zip(coefs, ps)])
                             for ps in zip(*path)))
     draw = Draw(image)
     draw.line(points, fill=color(), width=width)
     return image
Exemple #4
0
 def drawer(image, text):
     dx, height = image.size
     dx = dx / number
     path = [(dx * i, random.randint(0, height)) for i in range(1, number)]
     bcoefs = make_bezier(number - 1)
     points = []
     for coefs in bcoefs:
         points.append(
             tuple(
                 sum([coef * p for coef, p in zip(coefs, ps)])
                 for ps in zip(*path)))
     draw = Draw(image)
     draw.line(points, fill=color(), width=width)
     return image