# Coloring the Mandelbrot set using iterated points

I'm working on rendering the Mandelbrot set using K. I. Martin's method (http://www.superfractalthing.co.nf/sft_maths.pdf), and I am able to successfully use it to approximate the values of points in the set under iteration. However, now I have found myself faced with a small problem that I can't seem to get around.

Usually points not in the Mandelbrot set are colored based on the number of iterations it takes for them to escape, but since I only have access to the value of the points after a certain number of iterations and not the number of iterations it would have taken those points to escape, I have no way of creating the usual image of the Mandelbrot set.

I've tried using methods like taking one divided by the absolute value of the point (since larger points generally would have diverged faster), but methods like these leave me with pictures like this:

So, my question is, how can you color a point in the Mandelbrot set knowing only the value of that point after a certain number of iterations and not the number of iterations it took to diverge?

• Why can't you just add a variable to your code that keeps track of the number of iterations?
– Nick
Mar 17, 2018 at 3:01
• @Nick this method doesn't use iterations except to find the reference point. Sorry that I didn't mention this in my question Mar 17, 2018 at 3:17
• What is wrong with the image you have, except for the bad colourmap? (Note to others: It's hidden in the source, someone please edit it into the question.)
– user856
Mar 17, 2018 at 3:32
• @Rahul nothing's wrong with it, I just wanted to be able to have the usual colormap, instead of this one which repeats forever and doesn't show julia sets or anything Mar 17, 2018 at 11:53
• If you have (an approximation of) the absolute value of the $n$th iterate, it will increase smoothly away from the Mandelbrot set, so if you choose a smooth colourmap and an appropriate scaling you should be able to see the usual structure. What prevents you from using your preferred "usual colourmap" instead of the repeating colourmap in your current image?
– user856
Mar 17, 2018 at 15:59

K.I. Martin's paper has 2 techniques. The first is perturbation, where iterations of a pixel can be performed in low precision relative to a high precision reference. The second is series approximation, which allows to initialize all the pixels to a neighbourhood of the high precision reference after skipping some iterations. You can combine both techniques.

Typically you would use series approximation to initialize your pixels, then iterate them with the perturbed iteration formula until they or the reference escapes, or you reach a maximum iteration limit (if the reference escapes early, you need to find a better one).

An issue not mentioned it the paper is the occurence of "glitches", where the dynamics of the pixel differ too much from the dynamics of the reference. These can be detected and corrected by using a more appropriate reference.

More information on this stuff can be found (historical archive) at http://www.fractalforums.com and (current research) https://fractalforums.org .

You need to modify your program to repeat the iterations after iterations. For example if you need 200 iterations and you only have access to 100 iterations, you save the values after the first 100 iterates and then iterate again to get to your 200 iterations.

• I don't have access to any iterations at all; this method estimates the values of points for a certain number of iterations without iterating them. If there's no way to do it should I just abandon the method entirely and go back to the traditional method (not optimal because I'm trying to do deep zooms)? Mar 17, 2018 at 3:16
• Yes, that is a good idea. The traditional method is probably slower but what else? Mar 17, 2018 at 3:21
• well the reason I was doing it originally is because it can do basically infinitely deep zooms without needing arbitrary precision libraries, but I can probably get away with using a reference point iteratively and still have it working relatively fast. Thanks for your answer! Mar 17, 2018 at 3:24
• Thanks for your attention and good luck with the Mandelbrot set. Mar 17, 2018 at 3:26