Complex Domain Coloring  

Complex Domain Coloring was introduced to me by Jan Hlavacek as a way of visualizing a function of a complex variable by associating a complex number with a color. The basic idea is to express the color in its HSV representation, where the phase of the complex number determines the color's hue, and the modulus of the complex number gives the color's saturation and value. With builtin support for complex numbers and an easy to use PNG module, SLang is ideally suited for this sort of task. In fact, the background image that you see on this page was created through this technique using the function: To facilitate the creation of such images, I wrote a SLang script called fztopng that converts a userspecified function of a complex number to a PNG image. For information about obtaining fztopng and more details about its use, see its page. The function will be used to illustrate some of the capabilities of the fztopng. Here is what it shows the function to look like using the default coloring scheme:
fztopng also supports a coloring algorthm based solely upon the phase of the complex number. The phase is then used to linearly interpolate between two specified colors. Here is what the function looks like when colored using this algorithm: Very interesting pictures result when functions are iterated. For example, the first iteration of f(z) is which produces: The first iteration colored with the phaseonly algorithm looks a bit like a coatofarms: And the 10th iteration of f(z) resembles an Oriental rug: 
This page was last updated Nov 26, 2017 by John E. Davis. To comment on it or the material presented here, send email to jed at jedsoft org.