Skip to content

Latest commit

 

History

History
179 lines (140 loc) · 7.22 KB

README.md

File metadata and controls

179 lines (140 loc) · 7.22 KB

Julia

Julia is a simple fractal generator written in C. It can draw Julia set and Mandelbrot set with many different coloring algorithms.

Julia set

Building

Run make inside the repository. The program should compile on Linux without any problems (probably on Windows and Mac too). The only dependency of this program is the getopt library.

Usage

Run julia [OPTIONS]. Available options are

  • -a, --algorithm=ALGORITHM: set drawing algorithm;
  • -b, --bailout=BAILOUT: set bailout radius to BAILOUT;
  • -c, --center=POINT: set center of the image to POINT;
  • -d, --dimensions=DIMENSIONS: set dimensions of the image to DIMENSIONS;
  • -e, --exponent=EXPONENT: set exponent for computing multibrot;
  • -f, --fractal=FRACTAL: set fractal;
  • -h, --help: print help message;
  • -i, --iterations=ITERATIONS: set the iteration number;
  • -j, --julia=JULIA_CONST: render Julia fractal with JULIA_CONST as a parameter;
  • -k, --kappa=KAPPA: set KAPPA parameter;
  • -l, --load=PATHNAME: load PPM image from PATHNAME;
  • -o, --output=PATHNAME: set output image path to PATHNAME;
  • -p, --palette=PATHNAME: load palette from PATHNAME;
  • -r, --render=OUTSIDE:INSIDE: set coloring technique to INSIDE and OUTSIDE;
  • -z, --zoom=ZOOM: set zoom factor to ZOOM;

Parameter ALGORITHM can be one of the following numbers:

  1. Escape-time algorithm (default)
  2. Inverse iteration algorithm
  3. Budhabrot algorithm

Parameters POINT and JULIA_CONST should be given in format REAL:IMAGINARY, where REAL and IMAGINARY are doubles. Parameter DIMENSIONS should be given in format WIDTH:HEIGHT, where WIDTH and HEIGHT are unsigned integers. Parameter EXPONENT should be double, and parameter ZOOM should be positive double

Parameter FRACTAL can be one of the following numbers:

  1. Mandelbrot (default)
  2. Multibrot
  3. Mandelbar
  4. Burning ship

Parameter OUTSIDE can be one of the following numbers (only for the escape time algorithm):

  1. Plain coloring (default)
  2. Classic coloring
  3. Continuous coloring
  4. Smooth coloring
  5. Argument coloring (only works with low KAPPA number)
  6. Continuous argument coloring (only works with low KAPPA number)
  7. Grid coloring
  8. Grid image (PPM image must be loaded with the -l option)
  9. Distance estimation coloring
  10. Green function coloring
  11. Botcher function coloring
  12. Botcher image coloring (PPM image must be loaded with the -l option)

Most of given types of outside coloring work properly only if BAILOUT is set to large number (>103).

Parameter INSIDE can be one of the following numbers (only for the escape time algorithm):

  1. Plain coloring (default)
  2. Rainbow disk coloring (best results are acquired with the lower iteration number)
  3. Inside image coloring (PPM image must be loaded with the -l option)
  4. Convergence speed coloring
  5. Argument coloring (best results are acquired with the lower iteration number)
  6. Continuous argument coloring (best results are acquired with the lower iteration number)

Parameter KAPPA should be an unsigned integer. It is used as a parameter for different algorithms:

  • if Argument, Continuous argument, Rainbow disk or Inside image coloring is used, KAPPA will determine which iteration is used for coloring (default is 5);
  • if Budhabrot or Inverse iteration algorithm is used, KAPPA will determine the number of random points used for drawing (default is 10 for IMM, and 100000 for Budhabrot).

See Examples to see how to use options.

Coloring techniques

For better image quality draw bigger images and then resize them down with some image processing software (eg. Photoshop). The following images marked with ↙️ are processed this way.

Inside rendering techniques:

Plain coloring Rainbow disk coloring Inside image coloring
Plain coloring Rainbow disk coloring Inside image coloring ↙️
Convergence speed coloring Argument coloring Continuous argument coloring
Convergence speed coloring Argument coloring Continuous argument coloring

Outside rendering techniques:

Plain coloring Classic coloring Continuous coloring Smooth coloring
Plain coloring Classic coloring Continuous coloring Smooth coloring
Argument coloring Continuous argument coloring Grid coloring Grid image
Argument coloring Continuous argument coloring Grid coloring ↙️ Grid image ↙️
Distance estimation coloring Green function coloring Botcher function coloring Botcher image coloring
Distance estimation coloring Green function coloring Botcher function coloring Botcher image coloring ↙️

Palettes

Palette file should be a plain text file with a list of colors written in #RRGGBB format. Every color should be in a separate line. The first color is used as "inside" color (it will be used for coloring interior of fractals). See some examples in the palette folder.

Examples

./julia -f 0 -b 200 -i 100 -d 1000:600 -r 2 -p palette/blue_yellow -z 1.4

./julia -a 1 -j -0.5:0.35 -i 50 -d 1000:600 -z 1.4

./julia -j -0.2:0.3 -r 4:4 -i 50 -b 200 -k 5

Credits

The author of this program is Nikola Ubavić.

License

This project is licensed under the MIT License - see the LICENSE file for details.