Title: Fuzz Post by: HazardHarry on June 03, 2017, 12:21:16 AM I can't imagine I'm the first person to come up with this, but I haven't seen it used outside of my own program yet. Basically, the idea is to introduce a bit of randomness to the output of your function with every iteration. As the randomness piles up, areas of the image that require high iteration counts become blurrier than areas of low iteration counts. This results in a pseudo-"depth-of-field" effect.
The following example code is written in Java. There's not much to it. Basically it just randomly "jiggles" the value of the incoming complex number by an amount based on the maxRealDistance and maxImageDistance parameters. Code: static Complex fuzz(Complex in, double maxRealDistance, double maxImagDistance) {Original: (http://i163.photobucket.com/albums/t287/Syrrah323/Normal%20900_zpswftxha0t.png) (http://s163.photobucket.com/user/Syrrah323/media/Normal%20900_zpswftxha0t.png.html) Fuzzed: (http://i163.photobucket.com/albums/t287/Syrrah323/Fuzz%20900_zpsd3jjkmqt.png) (http://s163.photobucket.com/user/Syrrah323/media/Fuzz%20900_zpsd3jjkmqt.png.html) Title: Re: Fuzz Post by: lycium on June 03, 2017, 06:41:45 AM This kind of transform is quite common in IFS (flam3, Apophysis, Chaotica, JWildfire etc) but I haven't seen it used in escape time fractals so far. Which are you using here?
Title: Re: Fuzz Post by: HazardHarry on June 04, 2017, 05:17:33 AM It's an escape time fractal in a program I wrote myself. It's something I hope to release in the future, but at the moment it needs some more user-friendly accommodations, haha.
Specifically, here's the function I used: (http://i163.photobucket.com/albums/t287/Syrrah323/Latex%20Code%20Corrected_zpslizdoafz.png) (http://s163.photobucket.com/user/Syrrah323/media/Latex%20Code%20Corrected_zpslizdoafz.png.html) Original code: Code: result = Complex.swap((u.sub(new Complex( Math.log(z.magnitude()), z.newArg() + (3 * Math.PI) / 2 ))).div(z).pow(new Complex(1, -2))); Code: result = Complex.fuzz(Complex.swap((u.sub(new Complex( Math.log(z.mod()), z.newArg() + (3 * Math.PI) / 2 ))).div(z).pow(new Complex(1, -2))), 0.01, 0.01); "u" is the complex constant. In this case it's equal to 0+7.142857142857146i. The "escape" occurs when |z| > 100. There are a couple of functions there I should take note of: The swap function swaps the real and imaginary components of the number inside of it. Code: static Complex swap(Complex in) {"newArg" is only "new" in the context of my own program. The old "arg" function I had worked differently. Code: private static double halfPi = Math.PI / 2; Title: Re: Fuzz Post by: lycium on June 04, 2017, 09:28:00 AM I see. Java is a bit of an unfortunate choice for a graphics application (performance and memory issues), but I guess it can be ok.
BTW, you seem to have a ton of code to handle special cases of cartesian -> polar angle conversion; have a look at Math.atan2(y, x) method :) Also, random TeX tip: escape your functions, eg "<slash>ln" (replace <slash> with an actual slash, the forum seems to eat slashes atmo) not "ln". Title: Re: Fuzz Post by: HazardHarry on June 04, 2017, 08:11:44 PM Yeah, Java's not great for extremely high iteration counts, so deep zooms are typically a no-go. That said, there's a lot of interesting things you can do with fractals without needing to do much zooming at all. :D Side benefit: Keeping it in Java keeps me on my toes. I've got to make as many optimizations as possible to make sure it doesn't take 8 years to render a single image. XD One day I'll port it all to a faster language. For now though I'm happy to just keep it as is. Thanks for the atan2 and LaTeX tips! |