Fractal Image Generator

This project was developed in June, 2011 as a project in the course of Fractals at the University. It is absolutely my own work.


Get it

General

This application builds at real-time images of wide set of famous fractals and custom models based on advanced mathematical models (Iterated Functional System). Then these fractals are drawn on the screen.


Valuable feature is included – there are two modes of drawing – scaled and real-size. The scaled mode is good if we want to see the whole picture. The real-size mode offers to see more detailed view of bigger fractals. Also the images could be saved to files.

Introduction

Some copy paste work here from wikipedia :)

Process

The generation of the fractals uses the Iterated Functional System model and calculates it recursively. More information about the algorithm could be found here.

Architecture


In the architecture, that builds the fractal generator, are participating the following objects:

  • Fractal Generator – recursively creates the fractal as square array with boolean values.
  • Generation Rule – contains collection with prepared rules, which could be used from the generator, and the rules that are used at the current moment.
  • Fractal Visualizator – contains the logic, that is used for visualization of the fractal as Bitmap image on the screen and to save it as .png file.
  • Fractal Generator Frame – gets everything together and lets the user to:
    • Visualize the fractal in two modes
    • Generate the fractal
    • Set the generation rules
    • Set the colors that are used for the fractal
    • Save the fractal image to a file

Settings

The fractal generation could be regulated using the settings:

  • Zero Rule: the rule that is used for iteration over zeros in the matrix.
  • One Rule: the rule that is used for iteration over ones in the matrix
  • Iterations: 1 to 9
  • Fractal: Box, Rotated Box, Haferman Carpet, Sierpinski Carpet, Cantor Dust, Cantor Square, Custom
  • Zero Color: the color that is used for painting the zeros from the result matrix
  • One Color: the color that is used for painting the ones from the result matrix
  • Should start generation from one or zero
  • Should scale the fractal

The generation rules could be changed only if the Fractal type selected is Custom. Otherwise the values of these fields are the rules that are used for the selected fractal.
The rules are written in the form [*,*,*];[*,*,*];[*,*,*] , where * is 0 or 1.