Implementing Decomposition Colouring

  • 4 Replies

0 Members and 1 Guest are viewing this topic.

Offline zenzero-2001

  • *
  • Fractal Freshman
  • *
  • Posts: 9
« 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 Furball
  • ***
  • Posts: 293
« 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: 9
« 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: 9
« 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: 9
« 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 »

Plain Menger in Infinite Decomposition

Started by hobold on Fractal movie gallery

1 Replies
Last post July 04, 2018, 09:10:52 PM
by knighty
reading off external angles from binary decomposition images

Started by claude on Fractal Mathematics And New Theories

4 Replies
Last post May 12, 2019, 06:18:19 PM
by Adam Majewski
Experiments with colouring and layers

Started by mrrudewords on Image Threads

398 Replies
Last post June 08, 2020, 04:32:37 AM
by gerson
Angle based colouring

Started by saka on Fractal movie gallery

2 Replies
Last post December 20, 2019, 02:05:36 AM
by saka
Last Length Increase colouring... well sort of...

Started by Sabine62 on Color Snippets

33 Replies
Last post June 08, 2019, 08:25:13 AM
by Sabine62