• Stars
    star
    105
  • Rank 328,196 (Top 7 %)
  • Language
    Go
  • License
    MIT License
  • Created over 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Mandelbrot image renderer in Go

gobrot

Gobrot is a mandelbrot image renderer written in Go. The renderer takes advantage of Go's concurrent and parallel programming feature known as goroutine.

Mandelbrot images are generated by applying a mathematical function to each complex number projected in the complex plane and determining for each whether they are bounded or escapes towards infinity. The mandelbrot set is defined by the following formula: z_{n+1} = z_n^2 + c.

Treating the real and imaginary parts of each number as image coordinates, pixels are colored according to how rapidly the sequence diverges, if at all.

Install

$ go install github.com/esimov/gobrot@latest

Run

Running $ gobrot will produce the following image:

sample

$ gobrot --help

Usage of gobrot:
  -file string
    	The rendered mandelbrot image filname (default "mandelbrot.png")
  -height int
    	Rendered image height (default 768)
  -iteration int
    	Iteration count (default 800)
  -palette string
    	Hippi | Plan9 | AfternoonBlue | SummerBeach | Biochimist | Fiesta (default "Hippi")
  -radius float
    	Escape Radius (default 0.125689)
  -smoothness int
    	The rendered mandelbrot set smoothness. For a more detailded and clear image use higher numbers. For 4xAA (AA = antialiasing) use -smoothness 4 (default 8)
  -step float
    	Color smooth step. Value should be greater than iteration count, otherwise the value will be adjusted to the iteration count. (default 6000)
  -width int
    	Rendered image width (default 1024)
  -xpos x
    	Point position on the real axis (defined on x axis) (default -0.00275)
  -ypos y
    	Point position on the imaginary axis (defined on y axis) (default 0.78912)

Here are some options you can try out. (The attached images are generated using the below commands.)

$ gobrot -palette "Hippi" -xpos -0.0091275 -ypos 0.7899912 -radius .01401245 -file "mandelbrot.png"
$ gobrot -palette "Plan9" -xpos -0.0091275 -ypos 0.7899912 -radius .01401245 -file "test2.png" -iteration 600 -step 600
$ gobrot -palette "Vivid" -xpos -0.00991275 -ypos 0.7899912 -radius .02401245 -file "test3.png" -iteration 800 -step 600 -smoothness 10 -width 1920 -height 1080
$ gobrot -palette "Hippi" -xpos -0.00275 -ypos 1.012 -radius .089999 -file "test4.png" -iteration 800 -step 600 -smoothness 10 -width 1920 -height 1080
$ gobrot -palette "Hippi" -xpos -0.00275 -ypos 0.78912 -radius .1256789 -file "test5.png" -iteration 800 -step 6000 -smoothness 10 -width 1920 -height 1080

By combining -palette, -iteration and -step values you can obtain differently colorized mandelbrot sets.

Check out my article for more details: http://esimov.com/2016/04/mandelbrot-renderer-in-go

TODO

  • Generate various images with a single command
  • Find dynamically the regions where a deep zoom will emerge new mandelbrot sets

Resources

More Repositories

1

caire

Content aware image resize library
Go
10,356
star
2

pigo

Fast face detection, pupil/eyes localization and facial landmark points detection library in pure Go.
Go
4,386
star
3

triangle

Convert images to computer generated art using delaunay triangulation.
Go
2,038
star
4

diagram

CLI app to convert ASCII arts into hand drawn diagrams.
Go
835
star
5

stackblur-go

A fast, almost Gaussian Blur implementation in Go
Go
256
star
6

dithergo

Various dithering algorithms implemented in Go
Go
167
star
7

forensic

Copy-move image forgery detection library.
Go
136
star
8

gogu

A comprehensive, reusable and efficient concurrent-safe generics utility functions and data structures library.
Go
97
star
9

colorquant

Go library for color quantization and dithering
Go
85
star
10

legoizer

A tool to convert images to Lego bricks.
Go
80
star
11

ascii-fluid

Terminal based ASCII fluid simulation controlled by your webcam. 🌊
Go
66
star
12

colidr

Coherent Line Drawing implementation in Go.
Go
55
star
13

pigo-wasm-demos

Webassembly demos showcasing the Pigo face detection library.
Go
53
star
14

gifter

Gif image renderer running in terminal.
Go
44
star
15

gospline

Implementing b-spline curves in Go
Go
37
star
16

cloth-physics

Desktop application for cloth physics simulation using Gio GUI.
Go
37
star
17

triangle-app

Desktop application for Triangle.
JavaScript
35
star
18

pigo-face-tracking

Play games with your head. A face tracking application using the Pigo library.
Go
27
star
19

asciibrot

ASCII mandelbrot fractal running in terminal
Go
22
star
20

facemask

Overlay a mask over a person's face
Go
17
star
21

pigo-openfaas-faceblur

OpenFaaS faceblur function using the Pigo face detector library. (https://github.com/esimov/pigo)
Go
17
star
22

minecraft.js

Simplex noise based minecraft map generator
JavaScript
17
star
23

caire-openfaas

OpenFaaS function for Caire, the content aware image resize library. (https://github.com/esimov/caire)
Go
13
star
24

pigo-openfaas

OpenFaaS function for face detection using the Pigo library. (https://github.com/esimov/pigo)
Go
12
star
25

openfaas-coherent-line-drawing

Coherent Line Drawing OpenFaaS function based on https://github.com/esimov/colidr
Go
11
star
26

gomp

Alpha compositing operations and blending modes in Go.
Go
10
star
27

pigo-gocv-benchmark

Pigo vs GoCV face detection benchmark comparison
Go
4
star
28

simplexnoise.js

Javascript simplex noise implementation based on Stefan Gustavson paper: http://webstaff.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
JavaScript
3
star
29

homebrew-triangle

Brew formula for Triangle.
Ruby
2
star
30

go-arena

Testing and benchmarking the new experimental Go memory arenas.
Go
2
star
31

talks

Talks I have given
TeX
1
star
32

flash-experiments

Old Flash (ActionScript3) experiments
ActionScript
1
star