Skip to content

Commit f000bbd

Browse files
authored
Merge pull request #24 from jackyarndley/development
Version 0.7.0
2 parents bcad4d9 + 48d4cbc commit f000bbd

15 files changed

+179
-145
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rust_fractal"
3-
version = "0.6.0"
3+
version = "0.7.0"
44
authors = ["jackyarndley <34801340+jackyarndley@users.noreply.github.com>"]
55
description = "Fast, efficient mandelbrot set renderer."
66
edition = "2018"

README.md

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
![image](render.png)
22

33
# rust-fractal
4-
A mandelbrot fractal image generator featuring perturbation theory and series approximation. A high precision reference point is iterated at arbitrary precision and the differences from this are calculated in machine precision. This allows for a large speedup in image generation specifically at high zoom levels. This generator features:
4+
A mandelbrot fractal renderer implementing both perturbation and series approximation. A reference point is iterated at high-precision, arbitrary precision and differences from this are calculated in machine precision. This allows for a large reduction in computation required to render and image, especially at high zoom levels. This generator features:
55

6-
- Perturbation based iteration count with glitch detection.
7-
- Glitch fixing through automatic reference movement and recalculation.
6+
- Perturbation based iteration with glitch detection.
7+
- Glitch correction through automatic reference movement and recalculation.
88
- Series approximation calculation to skip (and approximate) large amounts of perturbation iterations.
9-
- Multithreading of core perturbation loops through rayon.
10-
- Multiple colouring methods including iteration, histogram and distance.
11-
- Utilises scaling and mantissa-exponent based extended precision to allow for arbitrary zoom, whilst maintaining good performance. Verified to be working at depths exceeding E20000. Theoretically, this is only limited by MPFR's precision.
9+
- Probe based method to determine series approximation skip.
10+
- Multithreading of core loops through rayon.
11+
- Configurable location and rendering options.
12+
- Multiple save formats including PNG, EXR and KFR.
13+
- Utilises scaling and mantissa-exponent based extended precision to allow for arbitrary zoom, whilst maintaining good performance. Verified to be working at depths exceeding E50000. Theoretically, this is only limited by MPFR's precision.
1214

1315
## Usage
14-
You need to be able to compile the 'rug' crate. Look in the documentation for rug for more information on how to do this. Once all required dependencies have been installed, change the settings in the ```main.rs``` file located in ```src/```. Build and run the crate with:
16+
You need to be able to compile the 'rug' crate which requires a rust GNU toolchain. Look in the documentation for rug for more information on how to do this. Once all required dependencies have been installed, build the crate with:
1517

16-
```cargo run --release```
18+
```cargo build --release```
19+
20+
The created binary can then be used with some of the config files provided. For help with the options do:
21+
22+
```./target/release/main --help```
23+
24+
By default, an image of the set is placed in the ```./output``` folder with it's specific details. A typical call with custom settings would look like:
25+
26+
```./target/release/main -o default.toml locations/flake.toml```

assemble_video.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from PIL import Image
99

1010
frames_between_keyframes = 60
11-
maximum_keyframe_number = 728
1211
zoom_scale = 2.0
1312

1413
# log1.1 of 2 is 7.27
@@ -29,12 +28,14 @@
2928

3029
framebuffer = []
3130

32-
writer = imageio.get_writer(f"segment_{segment:08}.mp4", **kargs)
33-
segment_names.append(f"segment_{segment:08}.mp4")
31+
writer = imageio.get_writer(f"segments/segment_{segment:08}.mp4", **kargs)
32+
segment_names.append(f"segments/segment_{segment:08}.mp4")
3433

3534
files = glob.glob("output/*.png")
3635
files.sort()
3736

37+
maximum_keyframe_number = len(files) - 1
38+
3839
# We start with the previous image, this is modified
3940
previous_keyframe = Image.open(files[0])
4041

@@ -58,8 +59,8 @@
5859
framebuffer = []
5960

6061
# Writer for adding frames to the video
61-
writer = imageio.get_writer(f"segment_{segment:08}.mp4", **kargs)
62-
segment_names.append(f"segment_{segment:08}.mp4")
62+
writer = imageio.get_writer(f"segments/segment_{segment:08}.mp4", **kargs)
63+
segment_names.append(f"segments/segment_{segment:08}.mp4")
6364

6465
next_keyframe = Image.open(files[i + 1])
6566

default.toml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
image_width = 1000
22
image_height = 1000
3+
rotate = 0
4+
approximation_order = 0
5+
glitch_tolerance = 0.001
36
frames = 1
4-
export = "both"
5-
glitch_tolerance = 0.000001
7+
frame_offset = 0
68
zoom_scale = 2.0
7-
auto_adjust_iterations = true
9+
display_glitches = false
10+
auto_adjust_iterations = true
11+
probe_sampling = 3
12+
remove_centre = true
13+
export = "colour"

high.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
image_width = 1920
2+
image_height = 1080
3+
rotate = 0
4+
approximation_order = 32
5+
glitch_tolerance = 0.001
6+
frames = 9999
7+
frame_offset = 0
8+
zoom_scale = 2.0
9+
display_glitches = false
10+
auto_adjust_iterations = true
11+
probe_sampling = 3
12+
remove_centre = true
13+
export = "exr"

locations/e10000.toml

Lines changed: 4 additions & 0 deletions
Large diffs are not rendered by default.

locations/lya.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
real = "-1.76904090125288168240284276810365472222460651367280300612031519864776551390840630119504817227707689276670981344397551593371805167279428144061791279408701383958080000000000000000000000002e+00"
2+
imag = "-3.1605400272558568759745268636087334444350515177571908056976983793515506960262149704114708190147368048572976192049103272074188848768835600195188510326583157513e-03"
3+
zoom = "7.5E139"
4+
iterations = 350000

locations/threads_colour.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
real = "-1.47414176240993896848662071528158693194984033295350953280086668957218887059547144798782958583693228230313082538417736408312283756916583038548770140907148842507795182301203312327678867411139743734088820831422587016737770172651132123623347543560592366451320269312832570538759109480956462838749508907791843703924365245276567942898938125705618894029328612293147151908041951365498962465718017136637923540348122292958335790053092495783869799482899842041593944847198560523459306518247398734178583094840989359335916427349271969694638813455484795519139180535389178899499218726674005407958574308338167164971091115429523451479626131276956228048957227740597867681604973361307242906518836130901630810235591139999999999999999999"
2+
imag = "1.837028624819189477865631515035097395323927302572629030865933104000355714583818892052507681177756076074900340375874325858424795164505875785998449146862924507042300051932135130891413370393327740037629084197582966724720858559206941967648864807892583328760554952794324657809197148266317196316651597885791947076110274629246850125745470256068262793065499915106947670845209696879646797896797942904780372999446765698282800418563469062689909330151614815763561772821921612271912492631000218876452296900861545848888915227426092699498959036990046882718777435775562966053647880616647866656164419540502287729221470963175939777275863084020159079375481684880087569411323863960416637609668567855099418820244664E-94"
3+
zoom = "8.6e630"
4+
iterations = 1544151

locations/x.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
real = "-1.479796270901760024425279934770411525645551054432599517909807632824286254403907594526888466099962805022975196472549771681831234491695559852583955204986197762293872769474806903995564259040667568599770094383157857518790853771783314763231302599999999999999999999999998"
22
imag = "-0.001199443952813447746281973233374468444560314114132538362037569205657422216739564521471119107626453330996365067987088146663639996715939831819152248618042255824652268918299630897525386638029428706473919823922522752497780934312003352081931299999999999999999999999998"
33
iterations = 50000
4-
zoom = "4.27799999998E40"
4+
zoom = "4.27799999998E235"

0 commit comments

Comments
 (0)