29 lines
749 B
Python
29 lines
749 B
Python
|
from PIL import Image, ImageDraw
|
||
|
import noise
|
||
|
|
||
|
slides = []
|
||
|
width=500
|
||
|
height=500
|
||
|
#cycles=5948
|
||
|
cycles=595
|
||
|
divider=1000
|
||
|
divider=100
|
||
|
|
||
|
for lacu in range(0,cycles):
|
||
|
|
||
|
print("Lacunarity: "+str(round(lacu/divider,3)) )
|
||
|
|
||
|
img = Image.new('RGB', (width,height))
|
||
|
|
||
|
for x in range(1,width):
|
||
|
for y in range(1,height):
|
||
|
area = noise.pnoise2( x/128, y/128, octaves=50, persistence=0.5, lacunarity=round(lacu/divider,3), repeatx=width, repeaty=height, base=25 )
|
||
|
img.putpixel( (int(x),int(y)), round(area*255) )
|
||
|
|
||
|
d = ImageDraw.Draw(img)
|
||
|
d.text( (1,1), "Lacunarity: "+str(round(lacu/divider,3)), fill=(255,0,0))
|
||
|
|
||
|
slides.append(img)
|
||
|
|
||
|
slides[0].save("lacunarity.gif", save_all=True, append_images=slides[1:], optimize=True, duration=50, loop=0)
|