Parent Directory | Revision Log
Initial revision
1 | teddy | 1.1 | #!/usr/bin/python |
2 | |||
3 | import Image, sys | ||
4 | |||
5 | mandel= Image.new("L",(570,570)) | ||
6 | |||
7 | for x in range(0,570): | ||
8 | for y in range(0,285): | ||
9 | c= (x-285)/142.5 | ||
10 | c= c+(y-285)*(0+1j)/142.5 | ||
11 | z= i= 0 | ||
12 | while i<1000 and abs(z)<2: | ||
13 | z= z**2+c | ||
14 | i= i+1 | ||
15 | color= ((i**0.5)*40%256) | ||
16 | if i<1000: | ||
17 | mandel.putpixel((x,y), color) | ||
18 | mandel.putpixel((x, 569-y), color) | ||
19 | |||
20 | mandel.save(sys.stdout, "PNG") |
root@recompile.se | ViewVC Help |
Powered by ViewVC 1.1.26 |