Terminal Mandelbrot Visualizer
Find a file
2025-03-03 00:01:53 +01:00
completions Added Bitmap output 2025-02-06 00:30:25 +01:00
resources Added high-resolution Bitmap output example 2025-02-06 00:31:19 +01:00
.gitignore initial commit 2024-12-09 22:30:05 +01:00
LICENSE.md Clear licensing 2025-02-03 03:06:59 +01:00
Makefile initial commit 2024-12-09 22:30:05 +01:00
mandelbrot.d Refactor BMP header generation 2025-03-03 00:01:53 +01:00
README.adoc Added high-resolution Bitmap output example 2025-02-06 00:31:19 +01:00
zoom.py Added parallelization and max iteration count flag 2025-02-05 23:14:12 +01:00

= Terminal Mandelbrot Visualizer

A CLI tool that generates colorful visualizations of the Mandelbrot set in your terminal using ANSI escape codes.

== Features

* Customizable colors
* Customizable maximum iteration number
* Adjustable output dimensions
* Configurable view bounds
* https://en.wikipedia.org/wiki/Posterization[Posterization]
* Brightness adjustment
* Parallelization
* ANSI escape code 24 bit color output
* Bitmap image output

== Build

Build requires any D compiler

* https://dlang.org/download.html#dmd[DMD]
* https://gdcproject.org/downloads[GDC]
* https://github.com/ldc-developers/ldc#installation[LDC]

[source, bash]
----
# build executable
$ make

# install executable
$ sudo make install

# uninstall executable
$ sudo make uninstall
----

== Usage

----
mandelbrot [OPTIONS]

Arguments:
-x         --width Width of output
-y        --height Height of output
-f    --foreground Foreground color in hex
-b    --background Background color in hex
-p --posterization Set posterization level
-r          --root Set the nth root of the brightness level
-a        --bounds Set visible part of the fractal 'x0,y0,x1,y1'
-t         --ascii Only use ASCII characters
-q          --hash Hash brightness values, creates a strong visual variation between color bands
-i    --iterations Maximum number of iterations
-o        --output Output as Bitmap image
----

=== Examples

[source, bash]
----
mandelbrot -x 100 -y 60 -f 4040ff -b 080810
mandelbrot -p 15 -r 2
mandelbrot -a -1.5,-0.5,-0.75,0 -x 100 -y 80
mandelbrot -x 1500 -y 1000 -o ./output.bmp
----

== Gallery

[source, bash]
----
$ mandelbrot
----
image::./resources/normal.png[]

[source, bash]
----
$ mandelbrot -x 100 -y 60 -f 4040ff -b 080810
----
image::./resources/color_size.png[]

[source, bash]
----
$ mandelbrot -p 18 -r 1.7 -q
----
image::./resources/posterization_hash_root.png[]

[source, bash]
----
$ mandelbrot -a -1.50001692,-6.77048840e-05,-1.49988151,6.77048840e-05 -q -r 1.7 -x 100 -y 80
----
image::./resources/zoom.png[]

[source, bash]
----
$ mandelbrot -x 24000 -y 16000 -i 256 -r 2 -q -o output.bmp
----
image::./resources/output.png[]