Julia is a simple fractal generator written in C. It can draw Julia set and Mandelbrot set with many different coloring algorithms.
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.
Run julia [OPTIONS]
. Available options are
-a
,--algorithm=ALGORITHM
: set drawing algorithm;-b
,--bailout=BAILOUT
: set bailout radius toBAILOUT
;-c
,--center=POINT
: set center of the image toPOINT
;-d
,--dimensions=DIMENSIONS
: set dimensions of the image toDIMENSIONS
;-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 withJULIA_CONST
as a parameter;-k
,--kappa=KAPPA
: setKAPPA
parameter;-l
,--load=PATHNAME
: load PPM image fromPATHNAME
;-o
,--output=PATHNAME
: set output image path toPATHNAME
;-p
,--palette=PATHNAME
: load palette fromPATHNAME
;-r
,--render=OUTSIDE:INSIDE
: set coloring technique toINSIDE
andOUTSIDE
;-z
,--zoom=ZOOM
: set zoom factor toZOOM
;
Parameter ALGORITHM
can be one of the following numbers:
- Escape-time algorithm (default)
- Inverse iteration algorithm
- 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:
- Mandelbrot (default)
- Multibrot
- Mandelbar
- Burning ship
Parameter OUTSIDE
can be one of the following numbers (only for the escape time algorithm):
- Plain coloring (default)
- Classic coloring
- Continuous coloring
- Smooth coloring
- Argument coloring (only works with low
KAPPA
number) - Continuous argument coloring (only works with low
KAPPA
number) - Grid coloring
- Grid image (PPM image must be loaded with the
-l
option) - Distance estimation coloring
- Green function coloring
- Botcher function coloring
- 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):
- Plain coloring (default)
- Rainbow disk coloring (best results are acquired with the lower iteration number)
- Inside image coloring (PPM image must be loaded with the
-l
option) - Convergence speed coloring
- Argument coloring (best results are acquired with the lower iteration number)
- 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.
For better image quality draw bigger images and then resize them down with some image processing software (eg. Photoshop). The following images marked with
Inside rendering techniques:
Plain coloring | Rainbow disk coloring | Inside image coloring |
Convergence speed coloring | Argument coloring | Continuous argument coloring |
Outside rendering techniques:
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.
./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
The author of this program is Nikola Ubavić.
This project is licensed under the MIT License - see the LICENSE file for details.