NextFractal is an application for creating amazing fractal images. The fractal images are generated from M language scripts. The M language is a Domain Specific Language designed for creating Mandelbrot and Julia sets. Moreover NextFractal provides tools for zooming and rotating fractals, browsing images, and exporting images as PNG files.

NextFractal is free software, available for Mac, Windows and Linux. NextFractal requires Java SDK 8 or later, a computer with multi-core CPU, a modern graphics card, and 1Gb of RAM. Download the software archive for your platform and decompress the archive in your preferred folder. Latest release and source code are available on GitHub.

The M language is a Domain Specific Language designed to create Mandelbrot and Julia sets. You can define the orbit algorithm and the color algorithm to use for generating the fractal image. You can define multiple color palettes and multiple orbit traps. You can use expressions to activate rules and to compute colors. You can use opacity to compose rules.

Please read the specification of the M language or download the grammar in PDF format.

The Mandelbrot set is one of the most fascinating objects which we can encounter in geometry. The discovery of this object in 1979 is attributed to BenĂ´it Mandelbrot, who also defined what is a Fractal and contributed in creating the Fractal Geometry. Mandelbrot introduced the word Fractal from latin Fractus which means irregular to describe a new class of objects which have similar properties like self-similarity and fractal dimension.

A Fractal is an object with an irregular geometric shape each part of which is statistically similar to the whole. In other words a Fractal contains copies of the whole object at different scale levels. Fractals may present a complex geometric structure which make fractal objects very rich of details.

The Mandelbrot set is defined as the set of points of the complex plane which generate orbits of a not linear system which don't converge to any attractor of that system.

The simplest Mandelbrot set you may create is the set of equation x ^ 2 + w which represent a not linear system x(i) = x(i - 1) * x(i - 1) + w, where x and w are complex numbers, i is a positive integer number, and the initial state is x(0) = 0.

In order to represent the Mandelbrot set of equation x ^ 2 + w on the screen of your computer, you have to map the pixels of the screen to the points of the complex plane. For each point (px,py) set w = px + py i, and iterate the system equation for i from 0 to n <= N, where |x(n)| > 2 or n = N, and N is the maximun number of iterations. You will generate a sequence of state values like x(0), x(1), x(2), ..., x(n), which represents the orbit of point (px,py). Finally color the pixel with a color derived as function of the state values and/or iteration n.

The M script for generating the Mandelbrot set of equation x ^ 2 + w is very simple. You can easily identify the region [<-3.0,-1.5>,<0.0,1.5>], the iteration interval [0,200], the loop condition |x| > 2, the system equation x = x * x + w, the background color (1,0,0,0), and the color rule which sets the pixel color to (1,1,1,1) when n > 0:

fractal { orbit [<-3.0,-1.5>,<0.0,1.5>] [x,n] { loop [0, 200] (|x| > 2) { x = x * x + w; } } color [(1,0,0,0)] { rule (n > 0) [1.0] { 1,1,1,1 } } }

The script above generates the image below when executed in NextFractal. You may change the region and zoom close to the frontier of the Mandelbrot set to see more details. The more you zoom, the more you find new details and you may find copies of the whole set. NextFractal provides tools for zooming, moving and rotating the images to discover new details.

The Julia sets and the Fatou sets are fractal objects derived from the Mandelbrot set. They are generated from the same equation of the Mandelbrot set but with a different initial state. Actually the Mandelbrot set is a map of all possible Julia and Fatou sets. Each point inside the Mandelbrot set generates a Julia set, and each point outside the Mandelbrot set generates a Fatou set. All the Julia sets are totally connected as the Mandelbrot set, and all the Fatou sets are not connected (for that reason they are also called fractal dust).

In order to represent a Julia or a Fatou set on the screen of your computer, you have to map the pixels of the screen to the points of the complex plane. Given a point (wx,wy), for each point (px,py) set x = px + py i and w = wx + wy i, and iterate the system equation for i from 0 to n <= N, where |x(n)| > 2 or n = N, and N is the maximun number of iterations. You will generate a sequence of state values like x(0), x(1), x(2), ..., x(n), which represents the orbit of point (px,py). Finally color the pixel with a color derived as function of the state values and/or iteration n.

The M script for generating a Julia or a Fatou set is very similar to the script for generating the Mandelbrot set. They differ for the initial values of w and x. For Julia and Fatou sets w is a constant and x is a variable. The constant w determines the shape of the fractal:

fractal { orbit [<-1.5,-1.5>,<1.5,1.5>] [x,n] { begin { x = w; w = <0.26,0.52>; } loop [0, 200] (|x| > 2) { x = x * x + w; } } color [(1,0,0,0)] { rule (n > 0) [1.0] { 1,1,1,1 } } }

NextFractal provides tools for generating a Julia and Fatou set for a specific point (wx,wy) from a Mandelbrot set. You don't need to provide the value of (wx,wy) in most of the cases, and you don't need to insert the begin statement in your script unless you want to force a specific value as in the example above. You can easily verify that the point (wx,wy), the shape of Julia or Fatou set and the shape of Mandelbrot set of in a region close to the point (wx,wy) are related.

Please see the examples below if you want to know more about the M language. These examples show you how to use the M language to generate fractals and implement various techniques for computing colors.

Example #1

Mandelbrot set with two colors

Example #2

Mandelbrot set with simple gradient

Example #3

Mandelbrot set with binary decomposition

Example #4

Combine gradient with not linear function

Example #5

Derive color from modulus of state variable

Example #6

Derive color from phase of state variable

Example #7

Use opacity to compose rules

Example #8

Assign value to color component

Example #9

Assign value to alpha component

Example #10

Use expression to activate rule

Example #11

Use state variables in rule expression

Example #12

Use state variables in color expression