Beispiel #1
0
    def draw(self, filename=''):

        self.pixels, size = movePointsTowardsOrigin( self.pixels )
        im = Image.new("RGB", tuple(size), (255,255,255))

        for pixel in self.pixels:
            im.putpixel(pixel, (0,0,0))

        if filename:
            im.save('img/'+ filename +'.png')
        else:
            im.show()
Beispiel #2
0
    def draw(self, filename=''):

        self.pixels, size = movePointsTowardsOrigin(self.pixels)
        im = Image.new("RGB", tuple(size), (255, 255, 255))

        for pixel in self.pixels:
            im.putpixel(pixel, (0, 0, 0))

        if filename:
            im.save('img/' + filename + '.png')
        else:
            im.show()
Beispiel #3
0
def draw_chaos_game(pixels, filename=''):

    #if weights == None:
    #    weights = [1] * n

    #pixels = chaos_game(n, r, weights, side, iteration, regular)
    pixels, size = movePointsTowardsOrigin( pixels )
    print size
    #print pixels
    im = Image.new("RGB", tuple(size), (255,255,255))

    for pixel in pixels:
        im.putpixel(pixel, (0,0,0))

    if filename:
        im.save('img/'+ filename +'.png')
    else:
        im.show()
Beispiel #4
0
def draw_chaos_game(pixels, filename=''):

    #if weights == None:
    #    weights = [1] * n

    #pixels = chaos_game(n, r, weights, side, iteration, regular)
    pixels, size = movePointsTowardsOrigin(pixels)
    print size
    #print pixels
    im = Image.new("RGB", tuple(size), (255, 255, 255))

    for pixel in pixels:
        im.putpixel(pixel, (0, 0, 0))

    if filename:
        im.save('img/' + filename + '.png')
    else:
        im.show()