tags:

views:

263

answers:

4
+5  Q: 

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.

+1  A: 

While I am not 100% aware of what the exact reason would be, I would assume it has more to do with efficiency. If you are going to iterate through every single point multiple times, it's going to waste a lot of processing cycles to get a picture which may not look a whole lot better. By doing random sampling you can reduce the amount work needed to be done - and given a large enough sample size still get a result that is difficult to "differentiate" from iterating over all the pixels (from a visual point of view).

Streklin
A: 

This is possibly some kind of Monte-Carlo method so yes, going over all pixels would produce the perfect result but would be horribly time consuming.

Why don't you just try it out and see what happens?

shoosh
+9  A: 

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. :-)

Melinda Green
+2  A: 

The same holds for flame fractals: Buddha brot are about finding the "attractors", so even if you start with a random point, it is assumed to quite quickly converge to these attracting curves. You typically avoid painting the first 10 pixels in the iteration or so anyways, so the starting point is not really relevant, BUT, to avoid doing the same computation twice, random sampling is much better. As mentioned, it eliminates the risk of artefacts.

But the most important feature of random sampling is that it has all levels of precision (in theory, at least). This is VERY important for fractals: they have details on all levels of precision, and hence require input from all levels as well.

Paxinum