Returning to the original topic of this thread regarding Fractint autolog coloring...
I was able to find this on
http://www.xmission.com/pub/lists/fractint/archive/v01.n005Date: Wed, 20 Aug 1997 10:45:03 -0600 (MDT)
From: <
robin.b2@ukonline.co.uk>
Subject: Re: (fractint) Question
On Wednesday, August 20, 1997 10:18:45 you wrote:
[... some stuff omitted ...]
What autolog does is do the calculations for all the pixels round the edge of your zoomed
view first, find out the lowest value it encountered and then use this as the lower end of
the colour spread used by logmap. This only gives good results if the fractal is one which
has no 'islands' of lower iterations inside such as the Mset.
Though this is the most 'efficient' way of using colours it also results in the colourmap
being shifted so you might need to cycle things a bit to get back to the look you had
before.
That agrees with what the source code is doing as far as I can tell. But it doesn't quite give all the details of how a count value is mapped to a color. The best I can figure from reviewing the source code is that the upper range of the log map is determined by maxiter (the iteration count limit) and the lower range is determined by the value of a global variable LogFlag, which is set to the minimum count value around the edge as described in the quote above.
So, to summarize, autolog seems to be doing this (u here means the value from 0 to 1 that selects which color a count value gets)
1. Let min = minimum count around edge of image
2. Let max = maxiter
3. For each count value cnt, calculate u = log (cnt-min) / log (max-min)
There are some fussy +1's and -1's here and there to avoid log(0) and to avoid overflowing table indexes, but that's the basic equation that's used.
There's also some range checking to deal with a case that apparently gives the user the option of having all counts below min get sent to the first color. For the autolog case, that is theoretically impossible since the boundary ought to contain the minimum count value in the entire image.
That last assumption, by the way, is not at all obviously true to me when rendering actual fractal images numerically. Certainly if we could sample the entire boundary of a region with infinite precision, it would be true for sets like the Mandelbrot set, but given numerical error, sampling artifacts, etc., I wouldn't be surprised if sometimes the boundary doesn't contain the minimum count for the whole region. This doesn't cause a problem in FractInt because the count mapping functions test all the cases to make sure they never take the log of 0 or of a negative number. But it's an interesting (well, at least to me) theoretical question.
I don't know whether UltraFractal contains an operation like this or not. I am also not fluent enought with UF programming to know whether it is possible to encode something like this into it -- do you get to tell it to do something like draw just the boundary of the image?
Finally, I would point out that I think a better function to use is
u = Log(cnt/min)/Log(max/min)
because of course what we are really trying to do is
u = [log(cnt) - log(min)] / [log(max) - log(min)]
This allows cnt to take on any nonzero value without giving the log function nonpositive numbers. It also removes the somewhat arbitrary value of the base of the logarithm from the problem, instead effectively taking the log of (cnt/min) to base (max/min).
OK. Phew. I hope that helps.