Ogless

Fractals

Ogless provides a fractal screen saver as just one of its image generating effects. Compared to other screen savers some only generate fractals and then these have very limited range of variability and flexibility. The images that it creates are so varied and alluring that we have devoted a separate gallery to them with a hundred screenshots of all the types of fractal images unique to Ogless.

Fractals are a branch of mathematically defined algorithms that are most commonly used to generate complex computer generated images.

The basis of the computation could not be much simpler, it involves the repeated squaring of a complex number (a number with real and imaginary parts).

a = x + iy;
a2 = (x+iy) * (x+iy);
a2 = x2 + 2iy + i2y;
a2 = x2 - y2 + 2ixy;

The real part of the result (x2 - y2) and the imaginary part (2ixy) are then passed to the next iteration. The standard fractal set is produced in graphical form by counting how many times this loop is executed before (x2 + y2) exceeds a certain value. The count of loop iterations is then converted to a color value and plotted according to the value of the initial position (x,y) value.

Without knowing the details of what the function does it is clear that an initial point very close to the origin (x=0; y=0) will take a very large number of iterations to reach (may be never) the limit. While a point far from the origin will take very few iterations to reach the value. It is the small region in between the two extremes that generates all the 'pretty' fractal patterns.

Fractal code in C++

double Fx, Fy, Initx, Inity, Sqx, Sqy;
int Loops;

Fx = Initx;
Fy = Inity;
for (Loops = 0; Loops < MAX_LOOP_ITERATIONS; Loops++)
{
  Sqy = Fy*Fy;
  Sqx = Fx*Fx;
  if (Sqx + Sqy > 2.0) break;
  Fy = 2.0*Fx*Fy + Inity;
  Fx = Sqx - Sqy + Initx;
}
// Plot the value of 'Loops' as a color for the initial position Initx, Inity
// ...

The World of Fractals

The most surprising feature of the Mandelbrot and Julia sets is that the intricate detail revealed is infinite in depth. If you zoom in on a small region then the smaller region is broadly similar to the larger one, and you can zoom in indefinitely - up to the limits of the capabilities of the processor. When you see a typical part of the fractal set you'll see spirals made up of spirals, each smaller spiral is a miniature version of the larger version.

Mandelbrot fractal

The standard Mandelbrot 'top level' picture. You can begin to see the intricate spirals that occur throughout the set.

The concept has been broadened to a general 'fractal' concept for anything that is similar on one scale than on another scale.

There are many different fractal algorithms that have been discovered. It is a powerful concept that can be applied to many fields of knowledge.

Fractals in the real world

The clearest example of a general fractal concept working in real-life comes from something amazingly simple. How do you measure the length of the coastline? It seems on face value a silly question, I just take a map and move around the coast totting up each mile measured. But then by doing this you are making an approximation, the coastline wiggles in and out and you should really take account of each cove and inlet. So the first figure is too low, but then where do you stop? When computing the length of coastline should you get the most detailed map and go around every cliff outline? But it does not stop there, as you can then consider whether each rock provides an extra level of detail that needs to be added. Moving from coves and beaches to rocks is one 'fractal' level as we then hit another consideration. Should each and every rock be considered? Some rocks are very angular going into each crevice would greatly add to the total. Even smooth rocks are made up of very angular crystals under a microscope. The search goes on down to the molecular and atomic scale. The coastline can be considered infinite in length, it all depends what level of detail you stop looking any further at. The fractal levels identified are cove/rock/crystal/molecule all with internal structure.

Another example of fractal scales is astronomical orbits. The moon goes around the Earth, the planets around the Sun, the Sun around the Galaxy and the Galaxies around the Galactic cluster. Also consider road networks, start at the motorway or inter-state highways and then main roads, small roads and lanes, they are all roads but differ in scale.

The interest in 'levels' of fractal has led to its application to human affairs. Can the rules and structures at the level of a state be applied to companies, cities and individuals? Re-using the same concepts at different levels can greatly simplify the situation. In software design it is also appealing to re-use the same set of procedures and functions on different objects at a different scale.

Often finding a set of fractal levels not only simplifies design but simplifies the understanding of a system as there are fewer concepts to take in.

Unlimited zoom

On a computer a fractal is usually computed using floating point arithmetic as this keeps the same level of accuracy for very large and very small numbers however it is still only an approximation and there comes a point where floating point 'rounding' and other errors creep in and affect the result. If you 'zoom' in a long way on a PC you will end up with a 'blocky' pixelated image just because of the limited size of representation of the number on it. If the floating point calculation uses a larger mantissa (more bits) then these effects will be delayed for longer. Intrinsically, as far we can tell the fractal set contains an infinite amount of detail, you never reach a point where there is no smaller structure.

Fractal compression

One of the exciting possibilities for fractals in the future is the very efficient encoding of complex data. This is most easy to see in the case of an image, the data required to create a fractal image is tiny - just some start parameters. The image produced with these parameters has a great deal of data that if we used an excellent compression file format would still require megabytes to store. So the attraction is very clear to see, from a few tens of bytes it is possible to encode something that would otherwise take megabytes to encode. As the Mandelbrot fractal set is 'infinite' the parameters should be able to specify some values that would approximate any image we want to encode. However finding a match is not easy, there is no real way to try to find a matching set of parameters other than trying them all in turn.

Ogless's fractals

The standard fractal algorithm is quite appealing but lacks something. It is just a bit too repetitive and regular. There are lots of interesting spirals but they all look somewhat similar even with different colors. What Ogless has set out to do is to create new algorithms unique to Ogless that enliven the displayed fractal image. It does this by making slight changes to the basic fractal computation - adding extra parameters and modifying others. We have ended up with eleven different variations of the fractal algorithm. Here is a list of them with some screenshots of what can be created using each one.

Name & DescriptionSample screenshot image
Modified

Here is the original Ogless fractal algorithm that we developed. It produces some very strange shapes - mainly heavily distorted and it takes a while to find an area that is not just 'random' linear curves and blobs.

Modified fractal
Sine

It is tempting to think that the combination of the smooth waves created by the trigonometric functions and a fractal should produce an interesting effect. However the sine function is not 'fractal' in nature - it is just a smooth curve and so the combination lacks the infinite depth of detail of the original, however there are areas where the superimposition creates pleasing symmetrical effects. In most areas the combination looks like a 'lens' distortion of the original fractal.

Sine fractal
Bauble

Quite by chance it was found that fiddling with the basic algorithm produced pleasing spherical looking 'beads' within the standard fractal landscape.

Bauble fractal
Superimpose (1)

If you take one area of the fractal set and combine it with another area then you'd expect to get some interesting effects. In fact, this algorithm looks less disturbed by the combination than might be expected.

Superimpose 1 fractal
Lace

By modifying the fractal algorithm as often as not you produce a distorted image. In the Lace variant the images produced are full of swirls and blobs rather than spirals. Many parts of this set are however just linear edges with no fine detail.

Lace fractal
Contort

A modified form that still keeps the repeated 'spiral' motif characteristic of standard fractals. However in this case there are areas of transition that have an interesting 'contorted' look. In some ways this is a mixture of Julia and Mandelbrot sets.

Contort fractal
Step

The concept used in this modified fractal is to add a repeated step to the algorithm, this had unexpected effects producing some of the most beautiful and least 'fractal' looking images.

Step fractal
Superimpose (2)

Another way of combining two areas of the fractal set was discovered that is similar to Superimpose (1) but subtly different.

Superimpose 2 fractal
Squash

As the name implies, this algorithm produces what looks like squashed versions of the standard fractal. Sometimes so squashed it just looks a mess so the area to view needs to be fairly selective.

Squash fractal
Break

One thing that makes fractal images boring is that they are so regular. This algorithm deliberately seeks to break it up a bit by adding lines and curves that seem to cut across the normal infinite spirals.

Break fractal
Quaternion

A quaternion is just saying everything is to the power 4. In our adaptation of this we have managed to produce fractals of intricate depth and beauty.

Quaternion fractal

Ogless's Fractal Screen Saver

When the Ogless screen saver is producing fractal images it does not just paint a static image. The image is scrolled around automatically so that you can see what the fractal looks like in neighbouring parts of the fractal set.

After a pause it will choose what it considers an interesting part of the existing screen image and zoom in on it. When that is complete it will scroll and zoom again. You'll be able to sit back and let Ogless explore the current set. If the screen image has become uninteresting then press Z to restart with different parameters.

If you stumble on an interesting fractal you can save a copy of the image away and you can also save the effect into your 'favorite' Ogless effects so you can see it again and again (press the F1 key key to access these options). Ogless chooses variations on areas of the fractal set that it knows hold interesting images or else it chooses an area at random.

OglessOgless lets you choose from a selection of color palettes. Available now from our download page.

References

Main Wikipedia entry on fractals
Biography of Mandelbrot - the man behind fractals
Gallery of a large range of different fractal types
Mathematical explanation of general principles of fractals
High quality Fractals images including some interesting animations
A Java applet for fractals with some mathematical explanation
Another java applet that explores the basic Julia and Mandlebrot sets
A good introduction to the general concepts of fractals
A Java applet allowing you to explore the Mandelbrot set with some description of what is happening
Detailed examination of properties of the Mandelbrot and Julia sets with example images
Overview of Fractal compression
Explanation of Fractal image compression

Copyright © Ogless and Silurian Software 2008-2010