Welcome to Fractal Forums

Fractal Software => Programming => Topic started by: asimes on August 30, 2013, 08:54:52 AM




Title: Buddhabrot renderer, JavaScript / Canvas
Post by: asimes on August 30, 2013, 08:54:52 AM
I rewrote an old Buddhabrot renderer of mine from Processing to JavaScript / Canvas: http://alexsimes.com/index.php?foo=visual%20programming&bar=buddhabrot

There is another post on the process (was originally meant to be a question on how to optimize it but ended up being largely a monologue of what I was doing to speed it up, ha ha): http://www.fractalforums.com/programming/buddhabrot-optimizations/

General summary of what it is doing:
- Each color channel (red, green, and blue) is treated as a separate Buddhabrot. Each color channel has its own maximum iterations for the Mandelbrot Set equation. Before running any code related to adding orbit traps, all pixels that do not belong to the Mandelbrot Set are found (for each color channel).

- The function for adding orbit traps alternates between the color channels. Each time a channel is chosen it tries to add 10,000 orbit traps. The random starting points are selected from an array of pixels that do not belong to the Mandelbrot Set (the last bulleted step). The pixel has a random deviation added to it (for a greater range of starting points) and then it is converted to the complex plane. If the random point still does not belong to the Mandelbrot Set after the random deviation is added, then it contributes to the appropriate value buffer depending on what color channel is being used.

- After 10,000 attempts (mostly successful) of adding orbit traps, the chosen color channel has a histogram made based on its value buffer. Using a cumulative distribution function the orbit traps for the chosen color channel are set to the normal 0 - 255 range but with a high contrast regardless of the state of the value buffer (due to the cumulative distribution function). An explanation of this process can be found here: http://en.wikipedia.org/wiki/Histogram_equalization#Small_image


Title: Re: Buddhabrot renderer, JavaScript / Canvas
Post by: tit_toinou on January 28, 2014, 12:42:53 PM
Nice!
I like your 3D Game of life by the way.


Title: Re: Buddhabrot renderer, JavaScript / Canvas
Post by: ker2x on January 29, 2014, 01:39:41 PM
I have the feeling that you're doing something wrong.
Can i get the source code please ?


Title: Re: Buddhabrot renderer, JavaScript / Canvas
Post by: asimes on January 29, 2014, 03:47:15 PM
@tit_toinou, Thanks

@ker2x, We went over this before in the topic linked above: http://www.fractalforums.com/programming/buddhabrot-optimizations/

It is JavaScript, the code for the project is its own .js file named buddhabrot.js. You can see it by looking at the page source in the browser, the link to the .js file is at the beginning in <head>.