def noise(self, image, number=50, level=2, color=None):
    (width, height) = image.size
    dx = (width / 10)
    width -= dx
    dy = (height / 10)
    height -= dy
    draw = Draw(image)
    for i in range(number):
        x = int(random.uniform(dx, width))
        y = int(random.uniform(dy, height))
        draw.line(((x, y), ((x + level), y)), fill=(color if color else self._color), width=level)
    return image
def noise(self, image, number=50, level=2, color=None):
    (width, height) = image.size
    dx = (width / 10)
    width -= dx
    dy = (height / 10)
    height -= dy
    draw = Draw(image)
    for i in range(number):
        x = int(random.uniform(dx, width))
        y = int(random.uniform(dy, height))
        draw.line(((x, y), ((x + level), y)), fill=(color if color else self._color), width=level)
    return image