Logo by KRAFTWERK - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Did you know ? you can use LaTex inside Postings on fractalforums.com!
 
*
Welcome, Guest. Please login or register. April 19, 2024, 03:10:07 PM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: 1 [2]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: How are B&W images from "Beauty of Fractals" created?  (Read 20436 times)
0 Members and 1 Guest are viewing this topic.
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #15 on: June 13, 2007, 04:53:03 PM »

.......  How do I estimate the rate of divergence?
(In particular I'm playing around with 3D Quaternions)
Thanks

I should have made clear that in the context of the DEM calculation my mentioning of the estimated degree of divergence only really applies to formulas like z^n+c - the generic DEM calculation is actually:

Before iterating (i.e. per-pixel) initialise a complex variable dz to (0,0)

At the end of each iteration compute the running derivative:
  dz = dz*f'(z) + 1.0

After bailout use something like:
  Dist. Est. = (p*log(cabs(z))*cabs(z)/cabs(dz))^ip
(where ip is 1/estimated divergence which could be calculated here using the method I mentioned for smooth iteration in my previous post)

For a Julia Set initialise dz to (1,0) and omit the +1 in the iteration calculation.

Where f(z) is the iterated formula and f'(z) is its derivative.

The above should work in Quaternion form as well as Complex.

« Last Edit: June 13, 2007, 04:59:21 PM by David Makin » Logged

The meaning and purpose of life is to give life purpose and meaning.

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
lycium
Fractal Supremo
*****
Posts: 1158



WWW
« Reply #16 on: June 13, 2007, 05:26:25 PM »

actually you don't need to do the full cabs() calculation, the result is the same if you don't calculate the two square roots.

not quite wink sqrt(x)/sqrt(y) doesn't give the same result as x/y (sqrt is nonlinear), but from the laws of exponents you can shave off one sqrt: sqrt(x/y)

edit: and that final sqrt you can pull out of the log via some log-identities, which i've mentioned in another thread somewhere.
« Last Edit: June 13, 2007, 05:28:44 PM by lycium » Logged

lycium
Fractal Supremo
*****
Posts: 1158



WWW
« Reply #17 on: June 13, 2007, 05:34:05 PM »

In particular I'm playing around with 3D Quaternions

i may have linked this elsewhere, but i'm pretty sure you'll find this interesting (the power of the gpu) and useful ("zealously commented" source code): http://graphics.cs.uiuc.edu/svn/kcrane/web/project_qjulia.html
Logged

David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #18 on: June 13, 2007, 05:46:21 PM »

actually you don't need to do the full cabs() calculation, the result is the same if you don't calculate the two square roots.

not quite wink sqrt(x)/sqrt(y) doesn't give the same result as x/y (sqrt is nonlinear), but from the laws of exponents you can shave off one sqrt: sqrt(x/y)

edit: and that final sqrt you can pull out of the log via some log-identities, which i've mentioned in another thread somewhere.

No, it does give the same result - the calculation for the rate of divergence is not log(sqrt(a)/sqrt(b)) but log(sqrt(a))/log(sqrt(b)) which is exactly the same as log(a)/log(b) :-)
« Last Edit: June 13, 2007, 05:51:56 PM by David Makin » Logged

The meaning and purpose of life is to give life purpose and meaning.

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
doncasteel8587
Guest
« Reply #19 on: June 13, 2007, 05:47:06 PM »

.......  How do I estimate the rate of divergence?
(In particular I'm playing around with 3D Quaternions)

 however normal smooth iteration calcuilation also involves the estimated degree of divergence and in that case we can actually calculate a value as log(cabs(final z))/log(cabs(penultimate z)) where final z is the bailed out value - actually you don't need to do the full cabs() calculation, the result is the same if you don't calculate the two square roots.



Is the value your calculating above the DEM or the value of p?
Logged
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #20 on: June 13, 2007, 05:52:51 PM »

.......  How do I estimate the rate of divergence?
(In particular I'm playing around with 3D Quaternions)

 however normal smooth iteration calcuilation also involves the estimated degree of divergence and in that case we can actually calculate a value as log(cabs(final z))/log(cabs(penultimate z)) where final z is the bailed out value - actually you don't need to do the full cabs() calculation, the result is the same if you don't calculate the two square roots.



Is the value your calculating above the DEM or the value of p?

This above is just for the value of p - the benefit of using this value rather than a fixed estiimate is that for some formulas (e.g. standard lambda, nova/halley etc.) the rate of divergence varies from one pixel to another in the fractal and of course for others e.g. involving conditionals, transcendentals etc. the "correct" value is simply very hard to guess/tweak and this calculated value takes that necessity away from the fractal artist.
« Last Edit: June 13, 2007, 05:57:17 PM by David Makin » Logged

The meaning and purpose of life is to give life purpose and meaning.

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
lycium
Fractal Supremo
*****
Posts: 1158



WWW
« Reply #21 on: June 13, 2007, 06:02:09 PM »

ah whoops, trust me to go simplifying the wrong equation wink done that way too often in exams as well... careless!
Logged

David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #22 on: June 13, 2007, 08:02:36 PM »

[After bailout use something like:
  Dist. Est. = (p*log(cabs(z))*cabs(z)/cabs(dz))^ip
(where ip is 1/estimated divergence which could be calculated here using the method I mentioned for smooth iteration in my previous post)

Duh !
Actually ignore the above for the calculation of ip - the value of ip used here should be fixed for the entire fractal but variable based on any parameter changes to the formula that change the overall divergence provided that the true derivative of the main formula is used in the iterative DEM calculation.

Having said that I'll just add that using the calculated divergence at bailout as I've described is great for smooth iteration colouring - in addition to what I've already mentioned (non uniform divergence across a fractal and difficult to specify divergence) calculating the value also gets you smooth iteration colouring with smaller bailouts than is normally the case for instance it produces smooth iteration colouring on the standard Mandelbrot with x^2+y^2<4.
Logged

The meaning and purpose of life is to give life purpose and meaning.

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
doncasteel8587
Guest
« Reply #23 on: June 13, 2007, 10:47:52 PM »

Ok....  now I'm lost    huh?

I can calulate the value of p by pixel after the iterations are complete with...
p =  log(cabs(final z))/log(cabs(penultimate z));

pm1 = p-1;
ip    = 1/p;

DistEst =  (p*log(cabs(z))*cabs(z)/cabs(dz))^ip;

dz is initialized to [0,0];

At each iteration dz = dz*p*(z^pm1) + 1;

What I can't figure out is what value to use for p to iterate dz inside the iteration loop?

Logged
doncasteel8587
Guest
« Reply #24 on: June 13, 2007, 11:54:51 PM »

It's not working, but Here's what I've gor so far in Fractorama.....
I may try it in ChaosPro tonight

formula
   {
   $maxcount = 1000;
   z=current;
   zOld = z;
   w=[real(z),imag(z)];
   c= [0.33,-0.52];
   dz=[0,0];

   z=(z*z)+w;
   $p = 1.5625;
   $pm1 = $p-1;
   $ip = 1/$p;
   while ($count < $maxcount && magnitude(z)<4)
      {
      zOld = z;
      z=(z*z)+c;
      $p = (log(magnitude(z))/log(magnitude(zOld)));
      $pm1 = $p-1;
      dz = dz*$p*(z^$pm1) + 1;
      }

   $ip = 1/$p;
   $distEst = ($p*log(magnitude(z))*magnitude(z)/magnitude(dz))^$ip;

      set_color
         (
         $distEst
         );
   }
Logged
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #25 on: June 14, 2007, 03:26:52 PM »

Hi all,

Sorry - I obviously confused everyone by mentioning that you can calculate the degree of divergence - it can only be calculated at the end i.e.
The calculation for the degree of divergence,

p = log(cabs(final z))/log(cabs(penultimate z))

Only works for the bailout (last) iteration where you're using final z and penultimate z, itr does not work with z and zold on any earlier iterations.

For z^2+c you should use p=2, pm1=1 and ip = 0.5 all fixed for the whole fractal, that holds for any z^p + c fractal eg. for z^3+c then p=3, pm1=2 and ip=0.3333333

For a general fractal z = f(z) then on each iteration you calculate:

dz = dz*f'(z) + 1.0

where f'(z) is the derivative of f(z)

and in the final calculation after bailout the ip value needs to be the inverse of the estimated divergence - again probably best using a fixed value for the whole fractal.
Logged

The meaning and purpose of life is to give life purpose and meaning.

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
flicker
Guest
« Reply #26 on: June 15, 2007, 05:36:41 PM »

Much of the math in these posts is over my head.  But I did spend quite a bit of time generating my own Mandelbrot images some years ago, using BASIC.  I assigned a pair of colors to each failure range, so that every single failure value got a unique space on the map.  Higher failure values had different color codes than lower, so I could see section by section how long it took each point to fail. 

If I were to use this approach simply with black and white, I could switch back and forth between black and white for every single failure value, and then when I was completely in, or completely out at a very low setting, I could use a constant color.  If I did that, I'd create a look not unlike the one shown early in this thread. 

I will say that in the 14 color scheme available to me in 1990, when I ran most of my fractals, I ended up with maps that looked like intertwined intestines.  Sometimes there's such a thing as knowing too much.
Logged
Nahee_Enterprises
World Renowned
Fractal Senior
******
Posts: 2250


use email to contact


nahee_enterprises Nahee.Enterprises NaheeEnterprise
WWW
« Reply #27 on: June 16, 2007, 07:21:49 AM »

Much of the math in these posts is over my head.  But I did spend quite a bit of time generating my own Mandelbrot images some years ago, using BASIC.  .......  Sometimes there's such a thing as knowing too much.

Greetings and welcome to this particular Forum !!      smiley

One can never know too much.     wink



Logged

Duncan C
Fractal Fanatic
****
Posts: 348



WWW
« Reply #28 on: August 22, 2007, 12:27:49 AM »

I will say that in the 14 color scheme available to me in 1990, when I ran most of my fractals, I ended up with maps that looked like intertwined intestines.  Sometimes there's such a thing as knowing too much.

You mean like this?
Logged

Regards,

Duncan C
Duncan C
Fractal Fanatic
****
Posts: 348



WWW
« Reply #29 on: January 11, 2008, 06:49:23 PM »

I'm finally generating DEM (Distance Estimate Method) based images that I'm happy with. It turns out that my code had a couple of bugs in it.

The new code runs reasonably fast, even with all the extra math to compute distance estimates.

The algorithm in S of F I ("The Science of Fractal Images" uses a sharp cut-off from white to black when pixels get close enough to the set, but I find this makes for jagged looking plots. I've implemented a non-linear color gradient that works pretty well.

For pixels where their DE value is  threshold>=DE>=0, I scale the value of DE to 1>=DE>=0, then do the calculation:
    gradient_value = 1 - (1-DE)^n,     ("^n" means to the n power. I wish I could use superscripts!)

"n" is an adjustment factor that lets me change the shape of the gradient curve.

The value "gradient_value" determines the color of the pixel. If it's 0, the pixel is colored at the starting color (white, for a B&W plot.) If "gradient_value" is 1, the pixel gets the end color (e.g. black)

For values of n>1, this gives a rapid change in color for pixels that are far from the set, and a slower change in value as DE approaches 0.

For values of n<1, it gives a slow color change for pixels far from the set, and rapid change close to the set. For n=1, I get a linear color gradient.

The non-linear gradient lets me use the DE value to anti-alias my plots. By adjusting my threshold value and my adjustment value, I can get good looking results for a variety of images.

Here is my latest version of the sample image from "The Beauty of Fractals":



And here are a couple of other images where I really like the lacy effect I get from DEM (the distance estimator method):







My app stores the DE value of each pixels, and does the color assignments at display time. This means that you can tweak the color values and get different looks without having to re-calculate the fractal.


Duncan C
Logged

Regards,

Duncan C
Pages: 1 [2]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Saying "Hi"+ few images Meet & Greet LhoghoNurbs 2 1308 Last post January 06, 2010, 06:31:52 PM
by Nahee_Enterprises
"The World is built on Fractals" - 65% Shipped Fractalforums.com Calendar Project cKleinhuis 0 1554 Last post December 17, 2012, 08:05:38 AM
by cKleinhuis
Manual "fractals" Other Artforms hapf 3 3020 Last post March 27, 2014, 09:39:50 PM
by Sockratease
A-Box Beamer--"A Monstrous Thing of Beauty"--3D FAMV Mandelbulber Gallery paigan0 1 738 Last post June 28, 2017, 07:05:22 AM
by CCV
Images Using "Perlin FBM Displacement" Transformation ChaosPro Gallery « 1 2 » Kalter Rauch 21 3029 Last post August 28, 2017, 02:08:07 AM
by Kalter Rauch

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.216 seconds with 27 queries. (Pretty URLs adds 0.012s, 2q)