The script mandelbrot.py
can be called from the command line, but parameters are passed in an if __name__=="__main__"
statement at the bottom of the script. I would implement a command line argument parser (and argparse
would be the way to do it) but I think the amount of effort required is greater than the reward.
The arguments for the primary function in the script are described below. The secondary function, print_progress_bar
, simply prints a progress bar, very much like what pip
uses. I borrowed this script from here.
a
: number between -2 and 2b
: number between -2 and 2 Above are only used injulia.py
initial_color_hue
: number between 0 and 1. Specifies the initial coloring based on HSV color model. Corresponds with Hue.color_scale
: how rapidly colors change while rendering the fractal Above are for use in a color smoothing algorithm. More info herezoom_level
: any number from 1 to inf.center_point
: point at which the image is centered. Bounded by ((-2, -2), (2, 2))max_iter
: number of iterations to run on a pixeljob
: helpful for when generating multiple fractals. First number that shows up in the image name.directory
: directory to save image in. Must be relative to current working directory.image_size
: Image size in pixels (tuple)image_save
: whether or not to save the image (boolean)x_max
: Maximum value on the real axis on which the fractal is defined. Highly recommended that this number (2.3) is not changed.aspect_ratio
: ratio between sides of imageverbose
: print information about generation of image (boolean)
If you have any questions, please let me know.