Search code examples
fractals

Buddhabrot Fractal


I am trying to implement buddhabrot fractal. I can't understand one thing: all implementations I inspected pick random points on the image to calculate the path of the particle escaping. Why do they do this? Why not go over all pixels?

What purpose do the random points serve? More points make better pictures so I think going over all pixels makes the best picture - am I wrong here?

From my test data:

Working on 400x400 picture. So 160 000 pixels to iterate if i go all over.

Using random sampling, Picture only starts to take shape after 1 million points. Good results show up around 1 billion random points which takes hours to compute.


Solution

  • Random sampling is better than grid sampling for two main reasons. First because grid sampling will introduce grid-like artifacts in the resulting image. Second is because grid sampling may not give you enough samples for a converged resulting image. If after completing a grid pass, you wanted more samples, you would need to make another pass with a slightly offset grid (so as not to resample the same points) or switch to a finer grid which may end up doing more work than is needed. Random sampling gives very smooth results and you can stop the process as soon as the image has converged or you are satisfied with the results.

    I'm the inventor of the technique so you can trust me on this. :-)