Skip to content
Generate beautiful fractals with TensorFlow! 🎨
Jupyter Notebook Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
img test gif Jul 22, 2017
.gitignore
Julia.ipynb init Jul 22, 2017
Mandelbrot.ipynb save Jul 22, 2017
README.md Update README.md Jul 22, 2017
julia.py init Jul 22, 2017
julia_gif.py add julia_gif.py Jul 22, 2017
mandelbrot.py init Jul 22, 2017
mandelbrot_area.py save Jul 22, 2017

README.md

tensorflow-fractal-playground

Use TensorFlow to generate beautiful fractals, including the Mandelbrot Set and the Julia set.

Requirements:

  • TensorFlow >= 1.0
  • PIL
  • moviepy(Optional, only useful when making a gif)

Generate the Standard Mandelbrot Set:

Run:

python mandelbrot.py

and check "mandelbrot.png":

Generate the Julia set:

Run:

python julia.py

and check "julia.png":

Modify the settings in julia.py to get a differnt Julia Set. The variable "c" is corresponding to the c of a Julia Set. The variable "bg_ratio" and "ratio" is used to set the colors.

Use the setting:

c = -0.8 * 1j
bg_ratio = (1, 3.5, 3.5)
ratio = (0.9, 0.9, 0.9)

Will get:

Use the setting:

c = 0.285 + 0.01 * 1j
bg_ratio = (4, 2.5, 1)
ratio = (2, 2, 0.1)

Will get:

Try more settings by yourself!

In addition, you can make an animation with Julia Set, Run:

python julia_gif.py

Then check out "julia_gif.gif":

Explore the Mandelbrot Set:

To get a local area image of Mandelbrot Set, run:

python mandelbrot_area.py

Check "mandelbrot.png":

Modify the varibales "start_x", "end_x", "start_y", "end_y" in mandelbrot_area.py to get a different area of the Mandelbrot Set. To get a different color, adjust the variables "ratio1, ratio2, ratio3".

For example, the following setting:

start_x = -0.090  # x range
end_x = -0.086
start_y = 0.654  # y range
end_y = 0.657
width = 1000
ratio1, ratio2, ratio3 = 0.2, 0.6, 0.6

will result in:

Setting:

start_x = -0.750  # x range
end_x = -0.747
start_y = 0.099  # y range
end_y = 0.102
width = 1000
ratio1, ratio2, ratio3 = 0.1, 0.1, 0.3

will generate:

Image Size:

The variable "width" controls the width of generated image.

If memory is a issue, please decrease it.

Jupyter Notebook:

You can use "Mandelbrot.ipynb" and "Julia.ipynb" for more convenient exploration. Enjoy it!

You can’t perform that action at this time.