Skip to content

Commit 4fe9cd6

Browse files
committed
readme update
1 parent 0c94dab commit 4fe9cd6

19 files changed

+57
-32
lines changed

img/crown.jpg

-204 KB
Binary file not shown.

img/crown.png

1.69 MB
Loading

img/julia.jpg

-104 KB
Binary file not shown.

img/julia.png

977 KB
Loading

img/lightning.jpg

-128 KB
Binary file not shown.

img/lightning.png

1.36 MB
Loading

img/mandelbrot.gif

2.43 MB
Loading

img/mandelbrot.jpg

-85.7 KB
Binary file not shown.

img/octogone.jpg

-155 KB
Binary file not shown.

img/octogone.png

1.54 MB
Loading

img/pow.png

1.3 MB
Loading

img/tiles.jpg

-211 KB
Binary file not shown.

img/tiles.png

1.39 MB
Loading

img/velvet.png

1.61 MB
Loading

img/wave.jpg

-144 KB
Binary file not shown.

img/wave.png

1.52 MB
Loading

img/web.png

1.1 MB
Loading

mandelbrot.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ def szoom_at(self, x, y, s):
494494
y - yrange * s,
495495
y + yrange * s]
496496

497-
def animate(self, x, y, file_out, n_frames=140, loop=True):
497+
def animate(self, x, y, file_out, n_frames=150, loop=True):
498498
"""Animated zoom to GIF file
499499
500500
Note that the Mandelbrot object is modified by this function

readme.md

+56-31
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
- **Accelerated on GPU** and CPU using numba CUDA JIT
55
- **Interactive exploration** using Matplotlib
66
- 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)
99
- 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
1112
- Customizable color palette
1213
- **Precision:** zoom down to float64 precision (approx. 16 significants digits)
13-
14-
All that in a 100% Python code 🐍
14+
- 100% Python 🐍
1515

1616
## Quick start
1717

@@ -30,18 +30,19 @@ mand.explore()
3030

3131
```python
3232
# Draw an image and save it to file
33-
mand.draw('mandelbrot.jpg')
33+
mand.draw('mandelbrot.png')
3434
```
35-
![](img/mandelbrot.jpg)
35+
![](img/mandelbrot.png)
3636

3737
### Make a zoom animation
3838

3939
```python
4040
# 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)
4243
# 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
4546
mand.animate(x_real, x_imag, 'mandelbrot.gif')
4647
```
4748
![](img/mandelbrot.gif)
@@ -59,70 +60,94 @@ Some examples of HD images, and corresponding code:
5960

6061
```python
6162
mand = Mandelbrot(maxiter = 5000, rgb_thetas = [.11, .02, .92], stripe_s = 2,
62-
light = [math.pi, 1., .25],
6363
coord = [-0.5503295086752807,
6464
-0.5503293049351449,
6565
-0.6259346555912755,
6666
-0.625934541001796])
67-
mand.draw('crown.jpg')
67+
mand.draw('crown.png')
6868
```
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)
7081

7182
```python
7283
mand = Mandelbrot(maxiter = 5000, rgb_thetas = [.83, .01, .99], stripe_s = 5,
73-
light = [-3*math.pi/4, 1., .25],
7484
coord = [-1.749289287806423,
7585
-1.7492892878054118,
7686
-1.8709586016347623e-06,
7787
-1.8709580332005737e-06])
78-
mand.draw('octogone.jpg')
88+
mand.draw('octogone.png')
7989
```
80-
![](img/octogone.jpg)
90+
![](img/octogone.png)
8191

8292
```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],
8594
coord = [-1.9415524417847085,
8695
-1.9415524394561112,
8796
0.00013385928801614168,
8897
0.00013386059768851223])
89-
mand.draw('julia.jpg')
98+
mand.draw('julia.png')
9099
```
91-
![](img/julia.jpg)
100+
![](img/julia.png)
92101

93102
```python
94103
mand = Mandelbrot(maxiter = 5000, rgb_thetas = [.54, .38, .35], stripe_s = 8,
95-
light = [-math.pi/4, 1., .1],
96104
coord = [-0.19569582393630502,
97105
-0.19569331188751315,
98106
1.1000276413181806,
99107
1.10002905416902])
100-
mand.draw('lightning.jpg')
108+
mand.draw('lightning.png')
101109
```
102-
![](img/lightning.jpg)
110+
![](img/lightning.png)
103111

104112
```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,
107124
coord = [-1.8605721473418524,
108125
-1.860572147340747,
109126
-3.1800170324714687e-06,
110127
-3.180016406837821e-06])
111-
mand.draw('wave.jpg')
128+
mand.draw('wave.png')
112129
```
113-
![](img/wave.jpg)
130+
![](img/wave.png)
114131

115132
```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],
118134
coord = [-0.7545217835886875,
119135
-0.7544770820676441,
120136
0.05716740181493137,
121137
0.05719254327783547])
122-
mand.draw('tiles.jpg')
138+
mand.draw('tiles.png')
123139
```
124-
![](img/tiles.jpg)
140+
![](img/tiles.png)
125141

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)
126151

127152
## Runtime 🚀
128153

0 commit comments

Comments
 (0)