Function Repository Resource:

RandomFractalArt (1.0.0) current version: 1.1.0 »

Source Notebook

Make a random fractal image based on the Mandelbrot Set

Contributed by: Mark Greenberg

ResourceFunction["RandomFractalArt"][]

returns an image of part of the Mandelbrot set randomly stylized.

Details and Options

RandomFractalArt starts with a random location near the border of the Mandelbrot set and zooms in a random amount. Then it applies two of several mapping functions to produce different layers. Each layer is randomly colored and has a style applied to it. The layers are combined with one of several combining functions. The combined image then may have symmetry transformations applied and/or bump added.
Renders can take up to 30 seconds for the default image size and longer for larger image sizes. Be patient.
ResourceFunction["RandomFractalArt"] will produce some images that are not visually interesting. Try again. Persistence pays off after a few tries.
ResourceFunction["RandomFractalArt"] takes the following options:
ImageSize{210, 210}sets the size of the final image
"IncludeRandomSeed"Falseassigns a random seed useful for reproducing an image
"OutputType""Image"determines the kind of output
The ImageSize option requires values in one of these forms:
{w,h}a list of two integers for width and height
na single integer equivalent to {n,n}
Tiny{105, 105}
Small{210, 210}
Medium{420, 420}
Large{840, 840}
The value assigned to the "IncludeRandomSeed" option should have one of these forms:
Truea random integer from 1 to a trillion, which is reported in the dataset output, seeds the random generator, allowing the image to be reproduced
Falseno random seeding is done so the final image cannot be reproduced by RandomFractalArt
nan integer to serve as the random seed
stra string to serve as the random seed
If the option "OutputType" is set to "Dataset", then instead of the fractal art image, the output of RandomFractalArt will be a dataset containing these items:
"random seed"the random seed used, if any
"fractal's center"the center of the image as a complex number
"layer 1 zoom level"the zoom factor of the first layer
"layer 1 color function"the color function of the first layer
"layer 1 mapping function"the mapping function used in the first layer
"layer 1 original"the image of the first layer without any style applied
"layer 1 style"the style applied to the first layer
"layer 1 with style"the image of the first layer with style applied
"layer 2..."the same data items for the second layer
"blending operation"the function used to combine the two layers
"blended image"the result of combining the two layers
"symmetry applied"what symmetry was applied, if any
"image with symmetry"the blended image with symmetry applied
"bump applied"the source of the bump map, if any
"image with bump"the final output of RandomFractalArt
The zoom levels of layer 1 and layer 2 only differ when the layers share the same mapping function.
The information in the dataset output is useful for tweaking the final fractal image, but it may not be sufficient for recreating it.
Images in the dataset output are twice the linear size of the final output. This allows for a smoother final render.

Examples

Basic Examples (1) 

Create a fractal image:

In[1]:=
ResourceFunction["RandomFractalArt"][]
Out[1]=

Scope (1) 

The more times you run the function, the better your chances of producing results that you find interesting:

In[2]:=
Table[ResourceFunction["RandomFractalArt"][ImageSize -> Tiny], 6]
In[3]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/d75b5b8f-627c-4812-8b94-8a4857aba307"]

Options (3) 

ImageSize (1) 

Often interesting details come out in larger images. The ImageSize option sets the size of the image:

In[4]:=
Table[ResourceFunction["RandomFractalArt"][ImageSize -> s], {s, 100, 475, 125}]
Out[4]=

IncludeRandomSeed (1) 

By including a random seed, you can experiment at a smaller size and then rerender the same fractal at a larger size:

In[5]:=
ResourceFunction["RandomFractalArt"][IncludeRandomSeed -> "Wolfram", ImageSize -> Tiny]
Out[5]=
In[6]:=
ResourceFunction["RandomFractalArt"][IncludeRandomSeed -> "Wolfram", ImageSize -> Medium]
Out[6]=

OutputType (1) 

By setting the "OutputType" option to "Dataset", you can get details about how the fractal was put together:

In[7]:=
ResourceFunction["RandomFractalArt"][IncludeRandomSeed -> "Waltham", OutputType -> "Dataset"]
Out[7]=

Applications (1) 

Make a unique banner background:

In[8]:=
ResourceFunction["RandomFractalArt"][ImageSize -> {800, 200}]
Out[8]=

Properties and Relations (1) 

While RandomFractalArt is for serendipitous discovery, the resource function MandlebrotSetRemap gives you control over how the image develops:

In[9]:=
ResourceFunction["MandelbrotSetRemap"][.385 - .27 I, 105, MaxIterations -> 54]
Out[9]=

Neat Examples (1) 

It is fun to see what your own fractal looks like (based on your name). Try different variations of your name for the random seed, for instance "John Smith", "John P. Smith", "John Paavan Smith", etc.:

In[10]:=
ResourceFunction["RandomFractalArt"][
 IncludeRandomSeed -> "John Smith", "ImageSize" -> Medium]
Out[10]=

Publisher

Mark Greenberg

Version History

  • 1.1.0 – 17 April 2023
  • 1.0.0 – 15 March 2023

Related Resources

Author Notes

License Information