Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions about the mandelbrot implementation #10

Open
Liukangmk opened this issue Mar 1, 2021 · 6 comments
Open

Questions about the mandelbrot implementation #10

Liukangmk opened this issue Mar 1, 2021 · 6 comments
Labels

Comments

@Liukangmk
Copy link

Liukangmk commented Mar 1, 2021

Hi. I am looking at the source of Fatou.jl to understand how the implementation of the Mandelbrot visualization is faster. I have a couple of questions:

  1. The n variable used is for horizontal grid points. Is that the same as the num of pixels/coordinates calculated? So it calculates for 176x176 pixels by default?

  2. The N is UInt8, and it means the maximum iteration per coordinate (or complex coordinate) is just 255. I've read that you would need at least a value of 1000 for the visualization to be quite accurate. Is this actually restricted to 255 or am I just confusing N with max iteration?

@chakravala
Copy link
Owner

  1. Yes, it specifies the horizontal pixel (vertical depends on the shape of the rectangular domain).
  2. Yes, N is UInt8 with 256 values, this is very convenient for making color images, which use the same range of values. This does restrict the number of iterations possible, otherwise a mapping from iteration count into UInt8 would also be required.

@VasanthManiVasi
Copy link

Shall I send a PR for the mapping from the number of iterations to UInt8? It would be a normalization from (0, num_iterations] to [0, 255]

@chakravala
Copy link
Owner

chakravala commented Mar 1, 2021

@VasanthManiVasi you are welcome to make a PR if you want, although I might change it around to suit my own style. For something super simple like this, I am willing to implement it myself for you also if it's desired.

Also, I'm not sure I want to normalize all iterations less than 255, so if you only go up to say 35 iterations, then I don't want the output necessarily to be normalized to 255, I want it to stay at 35 if preferable. Once it's over 255, it will need to be normalized.

@VasanthManiVasi
Copy link

Sure, please do! I'd love to run it for more iterations than currently supported!

chakravala added a commit that referenced this issue Mar 9, 2021
@chakravala
Copy link
Owner

In the latest commit of v1.1.1 of Fatou the UInt8 limitation has been replaced with UInt16 now, along with Makie support in addition to the existing PyPlot and ImageInTerminal functionality.

I expect you to pay me by sharing some beautiful or interesting fractal images as reproducible Fatou code snippets.

@chakravala
Copy link
Owner

Now v1.1.1 is officially registered by the way.

To address @Liukangmk original question about performance, in Fatou I am making use of Julia's parametric type compilation features with the Fatou.Define instances, which contain parametric type information to help speed up generated code. This allows the generic Fatou.orbit method to be custom compiled as fast as possible for each fractal specification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants