This is a basic result that shows mainly the color-changing structure:

And here is a more subtle image that shows increasingly complex stars of 5-fold symmetry

]]>

Zoom in to see the molten watch faces in this image:

Here I used the portrait of a damselfly, but you wont recognize much:

]]>

]]>

]]>

Note that this images are very large. You can zoom in and scroll around to explore them. They are different only because I used different input images.

Using a black and red bug on a yellow flower gave this:

A clematis made that:

And a red day-lily resulted in:

At first sight these images resemble same 19th century wallpapers.

]]>

The wave vectors (1,0) and (0,1) define designs of square symmetry that are aligned with the coordinate axis. We get the same designs rotated by an angle of 45 degrees from the wave vectors (1/√2,1/√2) and (1/√2,-1/√2). All wave vectors together give quasi-periodic designs with 8-fold rotational symmetry. A morphing arises if we combine these wave packages with varying weights.

To create an example I used a constant coefficient for the first set of waves. The weight for the second set vanishes at the border of the image and is equal to the weight of the first set at the center. Thus at the border we get a square lattice and the center has locally eight-fold rotational symmetry:

]]>

To show you a simple example, I made a design using wave packages based on cos(x) and sin(x) functions. It should match wave packages of a scale inflated by τ. Thus I used an additional wave package based on cos(x/τ). Wherever it has a negative value, the color of the design gets inverted. This matches the basic design and nicely accentuates its structure:

The center of perfect 5-fold symmetry lies in the lower left part.

The matching between the two different wavelengths is not surprising. The wave vectors of the mapping between output image and input image are of the form **k**_m=(cos(2πm/5),sin(2πm/5)). Noting that cos(2π/5)=1/(2τ) we get immediately that k_1+k_4=(1/τ,0), which is one of the waves used for controlling the color change. Thus sums of basic wave vectors give the smaller wave vectors of the inflated tiling.

]]>

For contracting mappings many pixels of the output image are mapped to the same single pixel of the input image. Without interpolation such a pixel appears magnified in the output image as a large patch of uniform color. You can see an example in “How to generate rosettes“. With cubic interpolation we can remove this defect , see the post “interpolation of pixels“.

For strongly expanding mappings neighboring output pixels are mapped to input pixels that lie far away from each other. If they are further apart than the size of characteristic details of the input image, then we get artifacts in the output image. An example are the nearly random pixels at the center of this spiral image:

This is essentially aliasing. We can improve the image by averaging, see “Smoothing and anti-aliasing“. Using four sampling points for each output pixel gives a much nicer image:

Obviously, interpolation and averaging slows down image generation and should only be used where needed. Often, we need neither of them. And never both. The generating program should analyze the mapping and choose the image improvement.

]]>

The position (x,y) of a pixel of the output image is the same as a complex number z=x+iy. The mapping to pixels of the input image takes several steps. First we use polar coordinates z=r exp(iφ) and the complex logarithm ln(z)=ln(r)+iφ. This maps the plane to an infinite horizontal strip of width 2π. We get a smooth output image if the image in this plane is periodic in y-direction with a period length of 2π. This corresponds to a translation vector (0,2π). We then can use a translation and scaling as a second mapping to a periodic transformation of the input image. This second mapping matches the translation vector to multiples of the periods of this image.

In the most simple case we get the periodic image from the input image with a mapping using packages of waves with square symmetry. If the components of the wave vectors are integers, then the basic periods are 2π in x- and y-direction and we have to transform the translation vector (0,2π) to a vector of the form 2π(m,n), where m and n are integers. If n is much larger than m then we see m different spiral arms. Each arm repeats n times a distorted primitive cell of the periodic image for one turn around the center. Other spirals will appear depending on the structure of the input image.

If h is the greatest common divisor of n and m then we get an h-fold rotational symmetry around the center of the spiral. As an example suppose that n is a multiple of m. Then we get an n-fold rotational symmetry.

We can similarly use periodic intermediate images of 3- and 6-fold rotational symmetry. Instead of a Cartesian lattice of integer choices (n,m) we then have a lattice of Eisenstein integers.

Here is a result for n=7 and m=2 with an intermediate periodic image of square symmetry. There is no particular rotational symmetry around the center because 2 and 7 are relatively prime. Strong diagonal accents of the periodic image give rise to additional spirals:

]]>

It’s a periodic image with square symmetry and no mirror symmetry. Its big grey discs are somewhat annoying. They arise because I used a simple cosine wave for each wave vector in its image mapping functions X(x,y) and Y(x,y). The cosine function cos(x) has a rather broad maximum at x=0. Thus X and Y do not vary much around x=y=0 where the grey discs lie.

To improve the image we want waves that vary more rapidly at the maximum and minimum, something more like a triangle wave with its sharp maxima and minima. Using the Fourier series of the triangle function we can add higher harmonics to the basic cos(x) function. Adding cos(3x)/9 we get already more details:

The circular shapes become more like squares. The deviation from mirror symmetry becomes more obvious.

Going further and replacing cos(x) by cos(x)+cos(3x)/9+cos(5x)/25 we have more structure:

Further convergence is slow. We should not exaggerate, because replacing the cosine by the triangle function gives a patched image:

Seems between patches appear as discontinuities in the directions of the black and white lines.

To speed up image creation you should use linear interpolation of tables for the sine and cosine functions as discussed in “fast approximations …“. You can improve on this using tables for the above combinations of trigonometric functions.

]]>