4
4
- ** Accelerated on GPU** and CPU using numba CUDA JIT
5
5
- ** Interactive exploration** using Matplotlib
6
6
- Use mousewheel or left/right click to zoom in/out
7
- - Use button and slider to change the color palette and the number of iterations
8
- - Save still and animated images
7
+ - Use sliders to change the rendering parameters
8
+ - Save still and animated images (GIF)
9
9
- Smooth iteration coloring, anti-aliasing by oversampling
10
- - ** Shading:** stripe average and Lambert normal
10
+ - ** Shading:** Blinn-Phong & Lambert lighting, stripe average coloring,
11
+ steps shading
11
12
- Customizable color palette
12
13
- ** Precision:** zoom down to float64 precision (approx. 16 significants digits)
13
-
14
- All that in a 100% Python code 🐍
14
+ - 100% Python 🐍
15
15
16
16
## Quick start
17
17
@@ -30,18 +30,19 @@ mand.explore()
30
30
31
31
``` python
32
32
# Draw an image and save it to file
33
- mand.draw(' mandelbrot.jpg ' )
33
+ mand.draw(' mandelbrot.png ' )
34
34
```
35
- ![ ] ( img/mandelbrot.jpg )
35
+ ![ ] ( img/mandelbrot.png )
36
36
37
37
### Make a zoom animation
38
38
39
39
``` python
40
40
# We decrease the image size to avoid overloading git and the readme page
41
- mand = Mandelbrot(maxiter = 2500 , xpixels = 426 )
41
+ # We also increase the number of iterations, and add stripe coloring
42
+ mand = Mandelbrot(maxiter = 5000 , xpixels = 426 , stripe_s = 5 )
42
43
# Point to zoom at
43
- x_real = - 1.7492404293151038
44
- x_imag = - 0.0002615793835705974
44
+ x_real = - 1.749705768080503
45
+ x_imag = - 6.13369029080495e-05
45
46
mand.animate(x_real, x_imag, ' mandelbrot.gif' )
46
47
```
47
48
![ ] ( img/mandelbrot.gif )
@@ -59,70 +60,94 @@ Some examples of HD images, and corresponding code:
59
60
60
61
``` python
61
62
mand = Mandelbrot(maxiter = 5000 , rgb_thetas = [.11 , .02 , .92 ], stripe_s = 2 ,
62
- light = [math.pi, 1 ., .25 ],
63
63
coord = [- 0.5503295086752807 ,
64
64
- 0.5503293049351449 ,
65
65
- 0.6259346555912755 ,
66
66
- 0.625934541001796 ])
67
- mand.draw(' crown.jpg ' )
67
+ mand.draw(' crown.png ' )
68
68
```
69
- ![ ] ( img/crown.jpg )
69
+ ![ ] ( img/crown.png )
70
+
71
+ ``` python
72
+ mand = Mandelbrot(maxiter = 5000 , rgb_thetas = [.29 , .02 , 0.9 ], ncycle = 8 ,
73
+ step_s = 10 ,
74
+ coord = [- 1.9854527029227764 ,
75
+ - 1.9854527027615938 ,
76
+ 0.00019009159314173224 ,
77
+ 0.00019009168379912058 ])
78
+ mand.draw(' pow.png' )
79
+ ```
80
+ ![ ] ( img/pow.png )
70
81
71
82
``` python
72
83
mand = Mandelbrot(maxiter = 5000 , rgb_thetas = [.83 , .01 , .99 ], stripe_s = 5 ,
73
- light = [- 3 * math.pi/ 4 , 1 ., .25 ],
74
84
coord = [- 1.749289287806423 ,
75
85
- 1.7492892878054118 ,
76
86
- 1.8709586016347623e-06 ,
77
87
- 1.8709580332005737e-06 ])
78
- mand.draw(' octogone.jpg ' )
88
+ mand.draw(' octogone.png ' )
79
89
```
80
- ![ ] ( img/octogone.jpg )
90
+ ![ ] ( img/octogone.png )
81
91
82
92
``` python
83
- mand = Mandelbrot(maxiter = 5000 , rgb_thetas = [.87 , .83 , .77 ], stripe_s = 0 ,
84
- light = [- math.pi/ 2 , 1 ., .15 ],
93
+ mand = Mandelbrot(maxiter = 5000 , rgb_thetas = [.87 , .83 , .77 ],
85
94
coord = [- 1.9415524417847085 ,
86
95
- 1.9415524394561112 ,
87
96
0.00013385928801614168 ,
88
97
0.00013386059768851223 ])
89
- mand.draw(' julia.jpg ' )
98
+ mand.draw(' julia.png ' )
90
99
```
91
- ![ ] ( img/julia.jpg )
100
+ ![ ] ( img/julia.png )
92
101
93
102
``` python
94
103
mand = Mandelbrot(maxiter = 5000 , rgb_thetas = [.54 , .38 , .35 ], stripe_s = 8 ,
95
- light = [- math.pi/ 4 , 1 ., .1 ],
96
104
coord = [- 0.19569582393630502 ,
97
105
- 0.19569331188751315 ,
98
106
1.1000276413181806 ,
99
107
1.10002905416902 ])
100
- mand.draw(' lightning.jpg ' )
108
+ mand.draw(' lightning.png ' )
101
109
```
102
- ![ ] ( img/lightning.jpg )
110
+ ![ ] ( img/lightning.png )
103
111
104
112
``` python
105
- mand = Mandelbrot(maxiter = 5000 , rgb_thetas = [.60 , .57 , .45 ], stripe_s = 12 ,
106
- light = [0 , 1 ., .1 ],
113
+ mand = Mandelbrot(maxiter = 5000 , rgb_thetas = [.47 , .51 , .63 ], step_s = 20 ,
114
+ coord = [- 1.7497082019887222 ,
115
+ - 1.749708201971718 ,
116
+ - 1.3693697170765535e-07 ,
117
+ - 1.369274301311596e-07 ])
118
+ mand.draw(' web.png' )
119
+ ```
120
+ ![ ] ( img/web.png )
121
+
122
+ ``` python
123
+ mand = Mandelbrot(maxiter = 5000 , rgb_thetas = [.6 , .57 , .45 ], stripe_s = 12 ,
107
124
coord = [- 1.8605721473418524 ,
108
125
- 1.860572147340747 ,
109
126
- 3.1800170324714687e-06 ,
110
127
- 3.180016406837821e-06 ])
111
- mand.draw(' wave.jpg ' )
128
+ mand.draw(' wave.png ' )
112
129
```
113
- ![ ] ( img/wave.jpg )
130
+ ![ ] ( img/wave.png )
114
131
115
132
``` python
116
- mand = Mandelbrot(maxiter = 5000 , rgb_thetas = [.63 , .83 , .98 ], stripe_s = 0 ,
117
- light = [math.pi/ 2 , 1 ., .25 ],
133
+ mand = Mandelbrot(maxiter = 5000 , rgb_thetas = [.63 , .83 , .98 ],
118
134
coord = [- 0.7545217835886875 ,
119
135
- 0.7544770820676441 ,
120
136
0.05716740181493137 ,
121
137
0.05719254327783547 ])
122
- mand.draw(' tiles.jpg ' )
138
+ mand.draw(' tiles.png ' )
123
139
```
124
- ![ ] ( img/tiles.jpg )
140
+ ![ ] ( img/tiles.png )
125
141
142
+ ``` python
143
+ mand = Mandelbrot(maxiter = 5000 , rgb_thetas = [.29 , .52 , .59 ], stripe_s = 5 ,
144
+ coord = [- 1.6241199193994318 ,
145
+ - 1.624119919281773 ,
146
+ - 0.00013088931048083944 ,
147
+ - 0.0001308892443058033 ])
148
+ mand.draw(' velvet.png' )
149
+ ```
150
+ ![ ] ( img/velvet.png )
126
151
127
152
## Runtime 🚀
128
153
0 commit comments