I am using the following algorithm to render the Mandelbrot set and the exterior:

• for each test point, calculate $c$

• initialise $z_{0}=(0+0i)$

• also initialise the gradient $dz_{0}=(0+0i)$

• iterate the following for the maximum allowed iterations

– calculate next $z$ using $z\mapsto z^{2}+c$

– calculate next gradient $dz$ using $dz\mapsto2\cdot z\cdot dz+1$

– break out of iteration loop if $|z|>4$ escape condition met

• calculate distance estimate as $d=\left(|z|\cdot\log|z|\right)/|dz|$

• colour the pixel based on distance estimate, eg $255\times\tanh(d\times \text{resolution}/\text{size})$ using a grey scale, 0-black, 255-white

The following shows a square viewport that has a bottom left at $(-0.7416363282638+0.1804439806419i)$, and a width of $0.008304417869$.

It seems to me that the red-circled mini-Mandelbrot shapes are part of the fully-connected Mandelbrot set and should be coloured black.

Question: Why are they white?

Thoughts: Even with non-zoomed views, I have seem some of the bulbs of The Mandelbrot coloured white.

The source of my algorithm is here, and this comment.

enter image description here


2 Answers 2


I think the formula you are using is valid only for points in the exterior. There is a more complicated formula for interior points, that you can find on this Wikipedia page.

Note that the formula refers to the period of the point under consideration. Also note that each mini-brot that you see corresponds to some particular period and each point in that mini-brot corresponds to a critical orbit whose period is a multiple of that common period.


As the other answer has explained, the distance estimate you're using is valid only when the point is outside of the Mandelbrot set. You simply need to modify your coloring algorithm so that points with forward orbits which do not escape (up to the limit of iteration) are immediately colored black. Only if they escape do you use the distance estimate to determine the color.

However, this approach may cause other problems, because it is conceivable that there are points in the image that are colored black only because the iteration limit is reached, and that they would eventually escape (i.e., the distance estimate is very small but positive). These points are currently represented in your image as gray, but would be captured as black instead. With sufficiently large iterations, discrimination between these cases would improve.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .