Logo by stardust4ever - 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: Visit us on facebook
 
*
Welcome, Guest. Please login or register. March 29, 2024, 09:36:22 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: Dumb Down Triangle Inequaltiy / Stripe Average / Curvature avg coloring methods  (Read 1253 times)
Description: Help me understand coloring methods Triangle Ineq / Stripe Average / Curvature .
0 Members and 2 Guests are viewing this topic.
MandelBRO
Forums Newbie
*
Posts: 5


« on: July 08, 2017, 03:15:39 AM »

Please help me understand the formulas to generate the band colorings of a fractal that use the formulas Triangle Inequality / Stripe Average / Average Curvature...etc as explained by JUssie Harkonen.

I am not a math genius so it needs to be dumbed down.

It seems like when I read his thesis... i think I understand it... but when I go to implement it, It's not working. It's close..... It seems like I'm not averaging far enough ahead or behind.... and when I try to average, it always loooks way worse.... all one color..... Not sure if i'm averaging incorrectly.... or using the value I obtain incorrectly.

I have read the two threads that talk about this subject and still do not understand.

I have tried many ways and i can't seem to get it to eliminate the banding:
  • All attempts had tested bailout values at 4, 1000, 1000000000 (thats the max value i can use without causing some overflow error)
  • Dividing the arcTanSum by the number of iterations.
  • Totaling only the last four values of the ArcTanSum and dividing by 4
  • Calculating 1 to 4 iterations past the bailout of Z
  • Using the arcTanSum value as a direct color value
  • Using the arcTanSum value as part of the smooth coloring formula - this is the closest I've got but it gets messy towards the fractal "edge"
  • I've watched videos about the catmull-Rom spline interpolation..... have no idea what numbers to use where or what to do with them if i even got them.

I am not sure if the things I have tried WERE correct idea but implemented INCORRECTLY...... or just plain wrong.

Here's my code:
I've left any code out that I figured was unimportant/ didn't affect calculations

Code:
For Y = 1 To H ' Image Height
            For x = 1 To W ' Image Width
               
                cRE = (((cX + x) - W / 2) * 4 / W) * Zoom
                cIM = (((cY + Y) - H / 2) * 4 / W) * Zoom

                Rx = 0
                Ry = 0
               

                inside = False
                arcTanSum= 0

                For I = 0 To MaxIterations

                    lastZ = Z
                    orX = Rx
                    orY = Ry

                    newX = Rx * Rx - Ry * Ry + cRE
                    Ry = (Rx + Rx) * Ry + cIM
                    Rx = newX
                    Z = Rx * Rx + Ry * Ry

                    arcTanSum = arcTanSum + 0.5 * Math.Sin(Math.Atan2(Ry, Rx)) + 0.5 'Formula I got from another thread from this forumn

                    If Z > EscapeVal Then
                        c = I
                        inside = True
                        Exit For
                    End If
                Next

                If inside Then

                    For ix = 0 To 3

                        newX = Rx * Rx - Ry * Ry + cRE
                        Ry = (Rx + Rx) * Ry + cIM
                        Rx = newX
                        Z = Rx * Rx + Ry * Ry
                        arcTanSum = arcTanSum+ 0.5 * Math.Sin(Math.Atan2(Ry, Rx)) + 0.5

                    Next

                    mu = ((arcTanSum)) + 1 - Math.Log(Math.Log((Math.Sqrt(Z)))) / Math.Log(EscapeVal)  ' This formula was initially used with variable 'C' (the iteration count at escape) to generate fraction for smooth iteration coloring

                    clr1 = Int(mu)
                    t2 = mu - clr1

                    t1 = 1 - t2
                    clr1 = clr1
                    clr2 = (clr1 + 1)

                    r = (Math.Sin(FreqR * (clr1) + PhaseR) * 127 + 128) * t1 + (Math.Sin(FreqR * (clr2) + PhaseR) * 127 + 128) * t2 'SMOOTH COLOR
                    g = (Math.Sin(FreqG * (clr1) + PhaseG) * 127 + 128) * t1 + (Math.Sin(FreqG * (clr2) + PhaseG) * 127 + 128) * t2 'SMOOTH COLOR
                    b = (Math.Sin(FreqB * (clr1) + PhaseB) * 127 + 128) * t1 + (Math.Sin(FreqB * (clr2) + PhaseB) * 127 + 128) * t2 'SMOOTH COLOR


                Else
                    r = 0
                    g = 0
                    b = 0
                End If

            Next

        Next



Here's one of the last fractals I generated attached.

I have visited many, many....many bulletin boards in my days seeking answers....and have always found. I have never posted a question myself because I've always found the answer and understood it enough to continue on. Please excuse any newbie mistakes I may have made in making this post.



* FRACTAL-1920x1080-2017-7-6-21-26-37-resized.png (183.82 KB, 360x203 - viewed 285 times.)
Logged
MandelBRO
Forums Newbie
*
Posts: 5


« Reply #1 on: August 21, 2017, 12:12:02 AM »

Nevermind! After a lot more trial and error, I finally figured out what I was doing wrong. One thing was I was using the wrong value of Z. I should have been using the last value of Z before the escape. I included the calculation for the upper and lower bounds correctly. I thought just using the previous Z value was the same as subtracting the real and imaginary parts from the Z value...  ... Also I realized the the value that it generated for the color is a number less than 1 and multiplying that number by the total colors gave me a color in an indexed palette..... but you can use that number directly if you use the math.sin and freguency phase method to calculate the actual color at run time. I got it to work doing the T.I.A. method and when that worked I went back and applied the same part to my angle calculations and it made the smooth lines like described by Jussi Harkonen.

Here's what it looks like now.... all smooth and no bands! Hooray!


* FRACTAL-1920x1080-2017-8-19.gif (203.47 KB, 640x360 - viewed 148 times.)
Logged
quaz0r
Fractal Molossus
**
Posts: 652



« Reply #2 on: August 21, 2017, 12:34:52 AM »

thanks for the posts on this; its one of the endless number of things i plan to implement but havent gotten around to yet   cheesy
Logged
Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Master's Thesis On Fractal Coloring Techniques (new) Theories & Research juharkonen 11 4068 Last post February 22, 2012, 07:46:20 PM
by tit_toinou
Stripe Average Mandelbrot 3 Images Showcase (Rate My Fractal) Zephitmaal 0 1512 Last post January 06, 2012, 09:52:58 AM
by Zephitmaal
Stripe Average Mandelbrot 2 Images Showcase (Rate My Fractal) Zephitmaal 0 2595 Last post January 06, 2012, 09:53:03 AM
by Zephitmaal
Stripe Average Coloring General Discussion « 1 2 » asimes 16 11161 Last post September 20, 2017, 05:49:49 PM
by Adam Majewski
Triangle Inequality Average Coloring Programming « 1 2 » CalvinCreator 15 7899 Last post April 26, 2017, 12:52:40 AM
by xenodreambuie

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