Implementing Decomposition Colouring

  • 4 Replies
  • 93 Views

0 Members and 1 Guest are viewing this topic.

Offline zenzero-2001

  • *
  • Fractal Freshman
  • *
  • Posts: 5
« on: July 09, 2018, 06:07:46 PM »
I have been trying to implement the decomposition colouring method as done by Ultra Fractal. The code is trivial:

Code: [Select]
    double result = atan2(zy, zx);

    if (result < 0.0)
    { result += TWO_PI; }

    return result;

To be exactly the same as the Ultra Fractal implementation the return value should be: result / TWO_PI . But this makes no difference to the problem I am experiencing. My version of the colouring gives sharp lines in the colours along the bands, e.g. on the positive x-axis and many other places. I compared my result to other fractal programs such as Saturn, and they look like my output. Therefore I conclude that Ultra Fractal is doing something else to the angle to avoid these lines? Any insights would be most welcome. Many thanks.

I have attached two images, the first is from Ultra Fractal and the second from my program.

Offline hobold

  • *
  • Fractal Fanatic
  • ***
  • Posts: 39
« Reply #1 on: July 09, 2018, 06:19:04 PM »
The color palette you are using does not seem to cycle back from end to start seamlessly. I mean, the starting color and the final color need to be the same, otherwise there will be a sharp jump when the end the end of one segment meets the start of another segment.

Offline zenzero-2001

  • *
  • Fractal Freshman
  • *
  • Posts: 5
« Reply #2 on: July 09, 2018, 08:08:09 PM »
Thanks hobold. I'm not convinced that is the problem, but I will definitely investigate the possibility. :)

Offline zenzero-2001

  • *
  • Fractal Freshman
  • *
  • Posts: 5
« Reply #3 on: July 10, 2018, 11:50:48 AM »
I had done some investigating previously, that in combination with holbold's comment confirms that it is palette index issue. When the angle switches to negative and we add TWO_PI then the resulting index is not adjacent to the previous index that was generated with a positive angle. This causes the apparent discontinuity.

I guess that Ultra Fractal does not do anything special with the actual decomposition calculation to get around this but rather does something later to correct the index. Will have to put my thinking cap on.

Offline zenzero-2001

  • *
  • Fractal Freshman
  • *
  • Posts: 5
« Reply #4 on: July 10, 2018, 12:52:13 PM »
Ahhh, that's why Ultra Fractal divides by TWO_PI - to normalize the result between 0.0 and 1.0 - honestly, sometimes I am so thick :-)

It definitely didn't work before even with dividing by TWO_PI, but I have changed the colour indexing since then.  :-[

All works now! Just had to make sure my colour density value was set correctly.

EDIT: Yes, it works correctly with whole number colour densities of 1 and higher but not with other densities, that's what confused me.
« Last Edit: July 10, 2018, 02:40:44 PM by zenzero-2001 »


xx
Plain Menger in Infinite Decomposition

Started by hobold on Fractal movie gallery

1 Replies
53 Views
Last post July 04, 2018, 09:10:52 PM
by knighty
xx
Experiments with colouring and layers

Started by mrrudewords on Image Threads

138 Replies
2233 Views
Last post June 22, 2018, 11:11:38 PM
by mrrudewords
clip
colouring by heightmap surface curvature

Started by claude on Fractal Mathematics And New Theories

4 Replies
236 Views
Last post October 12, 2017, 05:23:19 AM
by gerrit
xx
Burning Ship with Lyapunov exponent interior colouring

Started by claude on Fractal Image Gallery

2 Replies
137 Views
Last post January 09, 2018, 09:20:59 AM
by claude