Custom Palettes

Palette format

Palettes are constructed using a simple text format, for example:

Name: Blue & Red
60 120 255 255 255 255 255 255
255 255 255 255 255 0 0 255
255 0 0 255 60 120 255 255
0 1 1
Another colour format? As an experiment, I rewrote the colouring logic to use histogram colouring and GIMP gradients. Not only was this much slower (calculation and colouring became separate steps and colouring was no longer a simple lookup) no gradient file I tried gave me a more pleasing result than my old palette code. Fractint colour maps are for 256 colour displays and I have no idea how I'd go about weighting the intervals to avoid ugly banding. Gradient formats for other fractal generation programs - even if plain text - involve proprietary logic at the very least. So, yeah, I'm using my own format.

Line 1: Palette name

In anticipation of being able to install custom palettes at some point in the future, you are required to name them.

Line 2: Group count

Colour groups are defined by a start colour and an end colour. So that the palette can be parsed, you need to say how many colour groups the palette contains. There must be at least one.

Lines 3-5: Colour groups

Each colour line is made up of two lots of RGBA values defining the start colour and the end color (eight numbers in total). Values should be between 0 and 255 and can include a fractional part if you like.

Even though four values are used for each colour, the fourth (opacity) is currently ignored. All colours are fully opaque. However, including the value allows future support for transparency without requiring a new palette format.

Line 6: Weighting array

These values control the size of the colour groups when they're expanded. You must have at least as many values are there are colour groups (additional values are simply ignored). Weighting values are real numbers and should be greater than -1. The effect of the values are as follows:

Line 7: Colours per group (optional)

The base number for the size of colour groups. The expanded size of colour groups depends on both the overall palette size and the weighting value. If you don't supply a value, a default of eight is used.

Line 8: Mix channels after (optional)

When the palette is expanded, the colours of one group can be mixed with the colours of the previous group if the index is greater than or equal to this value. Since there isn't a previous group for group 0, a value of 0 disables this feature. If the value is 1, all colour groups are mixed. The default value is 0.

Using a custom palette

Here's a Julia set that has a particularly beautiful structure:

The Julia set of z2 + 0.23543446355295022-0.5198893148651992i

Because I want to emphasize the structure, I've set the boundary fraction to 4 from the default 8. Unfortunately, the built-in palettes obscure the structure. This is as good as I'm able to get:

As above, coloured using a built-in palette and a colour angle

I quite like it - it's certainly impressionistic - but it's not what I'm after. What I want is this: a colour up to the boundary of the fractal, pale colouring inside the boundary and some colour in the spirals. Look again at the sample palette at the top of the page. The colour groups are sky blue to white, white to red and red to sky blue. The 0-weighting on the first group means that the first colour transition will occur when the dwell value is ten. This is just about where things start to get interesting, taking care of the first requirement. The second and third colour groups will contain the other 1991 colours (the iteration count is 2000 and the palette expansion results in one palette entry for every iteration value unless instructed otherwise). Pasting the text into the palette edit control doesn't produce an immediately satisfying result because the second group is so wide that there is only the faintest hint of colour inside the boundary. I could experiment with the weighting values or create additional groups or I could limit the palette size. Setting "Maximum palette size" to 500 produces the effect that I'm looking for:

As above, coloured using a custom palette

This gives me something to play with. Setting the sky blue to black, inverting colours and applying a colour angle of 60° makes this:

Back to the index