Logo by Pauldelbrot - 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 26, 2024, 06:15:31 AM


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]   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: Faster Alternative to TIA coloring?  (Read 10938 times)
0 Members and 2 Guests are viewing this topic.
dbyrne
Guest
« on: April 03, 2010, 05:49:50 PM »

I've been messing around with branching average colorings like the triangle inequality average and curvature estimation algorithms and have come to the conclusion that they are needlessly slow.

To illustrate my point, compare these two images:
TIA: http://picasaweb.google.com/lh/photo/5My1RMT1lDd-jVJKRD70kg?feat=directlink
My method: http://picasaweb.google.com/lh/photo/olaMlO_Hzb3ILaWF7vu2yQ?feat=directlink

Both of these images use the same color scheme, iteration count, bailout, interpolation technique, etc.
The only difference is the addend function I used.  The TIA image took almost 75% longer to generate!  I guess my question is, given that the end result is so similar, whats the advantage to using TIA?

For those interested here is the code for the two different addend functions:

double TIA() {     
  double z_mag = sqrt(tia_prev_x*tia_prev_x + tia_prev_y*tia_prev_y);
  double c_mag =  c_mag = sqrt(P*P + Q*Q);
  double mn = z_mag - c_mag;
  mn = sqrt(mn*mn);
  double Mn = z_mag + c_mag;
  double num = sqrt(x*x + y*y) - mn;
  double den = Mn - mn;
  return num/den;
}

double myMethod() {
  return minVal(abs(y/x),2);
}
Logged
makc
Strange Attractor
***
Posts: 272



« Reply #1 on: April 03, 2010, 06:28:13 PM »

I like "my method" version better.
Logged
dbyrne
Guest
« Reply #2 on: April 03, 2010, 06:48:25 PM »

I like "my method" version better.

I do as well.  I actually think I could have tweaked "myMethod" to be even more visually similar to TIA, but left it as is because I liked it more.

Also, in my original post I said TIA took 75% longer, when in fact I meant that my method took 75% shorter, which is a much larger difference!
Logged
dbyrne
Guest
« Reply #3 on: April 03, 2010, 07:23:55 PM »

Also, I am not trying to say that my method will always produce a similar image to TIA.  Here is another example where the results vary much more:

TIA: http://picasaweb.google.com/lh/photo/YxDQNXaApv09SSOd7rq-Tw?feat=directlink
My method: http://picasaweb.google.com/lh/photo/iZl7kMmCua28lJQ9jFm-5A?feat=directlink

These are different enough I think both algorithms merit examination.  My real point is that any application where performance is a major concern should consider an alternative to TIA.
Logged
juharkonen
Forums Freshman
**
Posts: 17


« Reply #4 on: April 17, 2010, 11:25:08 AM »

 cheesy I remember making up the naming "branching average colorings" so it looks like you've been reading my master's thesis on coloring techniques (for anyone interested, it can be found in
http://www.violetindustries.com/gallery.php?cat=techniques).

As for TIA, I agree it's excessively complex to calculate and similar results can be achieved with much less calculation. In my thesis, I proposed the Stripes addend function as an alternative to TIA which is somewhat easier to calculate:
f(angle) = 0.5 + 0.5*sin(s*angle), where angle = arg {(x,y)} = atan(y/x) and s = integer constant

If I understood correctly, MyMethod corresponds to the addend function
t(angle) = min{tan(angle), 2} = min{tan(atan(y/x), 2} = min{y/x, 2}
Similar to TIA and Stripes, this method gives wave-like result as a function of angle which will lead to the branching appearance characteristic to TIA.

As for performance, MyMethod clearly has advantage because it avoids calculation of the argument with atan and doesn't involve any other trigonometric functions either. This can be significant especially on CPU because trigonometric functions are expensive. On the GPU, however, trigonometric functions are hardware accelerated and MyMethod ought to have slighter advantage.



Logged
dbyrne
Guest
« Reply #5 on: April 20, 2010, 06:01:06 AM »

Yes I have read your paper.  It is a great resource. I am writing fractal software for smartphones, so often a math coprocessor isn't available. I like your stripes algorithm a lot and have implemented it actually.
Logged
dbyrne
Guest
« Reply #6 on: April 20, 2010, 06:11:52 AM »

Actually I've been meaning to add a link to your paper in the documentation for my code.  Thanks for reminding me to do that.  embarrass
Logged
Duncan C
Fractal Fanatic
****
Posts: 348



WWW
« Reply #7 on: June 26, 2010, 05:53:02 PM »

I've been messing around with branching average colorings like the triangle inequality average and curvature estimation algorithms and have come to the conclusion that they are needlessly slow.

To illustrate my point, compare these two images:
TIA: http://picasaweb.google.com/lh/photo/5My1RMT1lDd-jVJKRD70kg?feat=directlink
My method: http://picasaweb.google.com/lh/photo/olaMlO_Hzb3ILaWF7vu2yQ?feat=directlink

Both of these images use the same color scheme, iteration count, bailout, interpolation technique, etc.
The only difference is the addend function I used.  The TIA image took almost 75% longer to generate!  I guess my question is, given that the end result is so similar, whats the advantage to using TIA?

For those interested here is the code for the two different addend functions:

double TIA() {     
  double z_mag = sqrt(tia_prev_x*tia_prev_x + tia_prev_y*tia_prev_y);
  double c_mag =  c_mag = sqrt(P*P + Q*Q);
  double mn = z_mag - c_mag;
  mn = sqrt(mn*mn);
  double Mn = z_mag + c_mag;
  double num = sqrt(x*x + y*y) - mn;
  double den = Mn - mn;
  return num/den;
}

double myMethod() {
  return minVal(abs(y/x),2);
}


Thanks for posting this. I've been trying to find info on how to implement TIA coloring. Can you explain a little more, though?


Do you calculate the TIA (or "my method") value at the iteration when a point steps outside the bailout circle? That yields a floating-point value. What do you do with that value?

Are the x and y values the real/imaginary coordinates of the Zn value?
Logged

Regards,

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

Related Topics
Subject Started by Replies Views Last post
Alternative spiral Images Showcase (Rate My Fractal) Dinkydau 0 1717 Last post March 01, 2013, 09:51:24 PM
by Dinkydau
alternative power interpolation (new) Theories & Research cKleinhuis 5 529 Last post February 03, 2015, 11:34:08 AM
by cKleinhuis
possible alternative to Shapeways? Non-Fractal related Chit-Chat DarkBeam 2 8232 Last post February 11, 2015, 08:31:18 PM
by slon_ru
An Idea for Faster(?) Calculation of 3D Fractal Surfaces Programming dru333 1 17068 Last post July 30, 2016, 05:33:01 AM
by claude
Virtualdub alternative question? Mandelbulb 3d Bibby 3 8384 Last post June 29, 2017, 08:21:19 PM
by PieMan597

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.152 seconds with 24 queries. (Pretty URLs adds 0.01s, 2q)