{"id":15639345,"url":"https://github.com/joweich/fractals","last_synced_at":"2025-08-16T00:31:20.626Z","repository":{"id":170097186,"uuid":"331460873","full_name":"joweich/fractals","owner":"joweich","description":"Fast mandelbrot set renderer using goroutines","archived":false,"fork":false,"pushed_at":"2025-05-05T03:56:28.000Z","size":6899,"stargazers_count":92,"open_issues_count":2,"forks_count":10,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-02T11:10:07.224Z","etag":null,"topics":["concurrency","fractal","generative-art","go","goroutine","mandelbrot"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"doge1338/fractal","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joweich.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-01-20T23:33:50.000Z","updated_at":"2025-04-21T08:48:07.000Z","dependencies_parsed_at":"2023-12-31T16:32:55.605Z","dependency_job_id":"69c1c332-c9a7-4251-9863-b25ae24dd87f","html_url":"https://github.com/joweich/fractals","commit_stats":null,"previous_names":["joweich/fractal","joweich/fractals"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/joweich/fractals","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joweich%2Ffractals","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joweich%2Ffractals/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joweich%2Ffractals/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joweich%2Ffractals/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joweich","download_url":"https://codeload.github.com/joweich/fractals/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joweich%2Ffractals/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270651031,"owners_count":24622432,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-15T02:00:12.559Z","response_time":110,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["concurrency","fractal","generative-art","go","goroutine","mandelbrot"],"created_at":"2024-10-03T11:25:30.183Z","updated_at":"2025-08-16T00:31:20.063Z","avatar_url":"https://github.com/joweich.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fractals\n\n**fractals** is a customizable renderer for the Mandelbrot set written in Go. It uses Go's **goroutines** to achieve high performance.\n\n### 🚀 Featured in [Golang Weekly #464](https://golangweekly.com/issues/464) 🚀 \n\n## Usage\n```sh\ngit clone https://github.com/joweich/fractals.git\ncd fractals\ngo build \n./fractals -h  # to see list of available customizations\n./fractals -height 1000 -width 1000 # fractals.exe for Windows systems\n```\n\n## Examples\n#### Colored\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003cimg src=\"/examples/ex1-zoom-1.png\" width=\"350\"\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003cimg src=\"/examples/ex2-zoom-53.png\" width=\"350\"\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003cimg src=\"/examples/ex5-zoom-4e12.png\" width=\"350\"\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003cimg src=\"/examples/ex4-zoom-1e11.png\" width=\"350\"\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n#### Grayscale\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003cimg src=\"/examples/ex6-gray-7.png\" width=\"350\"\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003cimg src=\"/examples/ex7-gray-8.png\" width=\"350\"\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003cimg src=\"/examples/ex8-gray-9.png\" width=\"350\"\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003cimg src=\"/examples/ex9-gray-48.png\" width=\"350\"\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## About the Algorithm\n### The Math in a Nutshell\nThe Mandelbrot set is defined as the set of complex numbers $c$ for which the series \n\n$$z_{n+1} = z²_n + c$$\n\nis bounded for all $n ≥ 0$. In other words, $c$ is part of the Mandelbrot set if $z_n$ does not approach infinity. This is equivalent to the  magnitude $|z_n| ≤ 2$ for all $n ≥ 0$.\n\n### But how is this visualized in a colorful image?\nThe image is interpreted as complex plane, i.e. the horizontal axis being the real part and the vertical axis representing the complex part of $c$. \n\nThe colors are determined by the so-called **naïve escape time algorithm**. It's as simple as that: A pixel is painted in a predefined color (often black) if it's in the set and will have another color if it's not. The color is determined by the number of iterations $n$ needed for $z_n$ to exceed $|z_n| = 2$. This $n$ is the escape time, and $|z_n| ≥ 2$ is the escape condition. In our implementation, this is done via the _hue_ parameter in the [HSL color model](https://en.wikipedia.org/wiki/HSL_and_HSV) for non-grayscale images, and the _lightness_ parameter for grayscale images.\n\n### And how does it leverage Goroutines?\nEach row of the image is added as a job to a [channel](https://go.dev/doc/effective_go#channels). These jobs are distributed using [goroutines](https://go.dev/doc/effective_go#goroutines) (lightweight threads managed by the Go runtime) that are spun off by consuming from the channel until it's empty.\n\n## Advanced Rendering Features\n* Linear color mixing ([source](https://github.com/ncruces/go-image/blob/v0.1.0/imageutil/srgb.go))\n* Anti-aliasing by random sampling ([source](https://www.fractalus.com/info/antialias.htm))\n* _Normative iteration count_ to smooth stair-step function ([math behind](http://linas.org/art-gallery/escape/escape.html))\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoweich%2Ffractals","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoweich%2Ffractals","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoweich%2Ffractals/lists"}