{"id":17070395,"url":"https://github.com/owainkenwayucl/fractals","last_synced_at":"2026-05-04T11:37:54.128Z","repository":{"id":81522065,"uuid":"150450862","full_name":"owainkenwayucl/Fractals","owner":"owainkenwayucl","description":"Python (some Julia!) tools for generating fractals","archived":false,"fork":false,"pushed_at":"2023-07-20T20:58:26.000Z","size":424,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-28T17:25:36.717Z","etag":null,"topics":["julia-sets","julialang","mandelbrot","numpy","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/owainkenwayucl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2018-09-26T15:43:25.000Z","updated_at":"2023-07-20T12:50:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"ad14b50c-d747-4f6c-8846-bd70a531f4aa","html_url":"https://github.com/owainkenwayucl/Fractals","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owainkenwayucl%2FFractals","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owainkenwayucl%2FFractals/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owainkenwayucl%2FFractals/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owainkenwayucl%2FFractals/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/owainkenwayucl","download_url":"https://codeload.github.com/owainkenwayucl/Fractals/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245090875,"owners_count":20559298,"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","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":["julia-sets","julialang","mandelbrot","numpy","python3"],"created_at":"2024-10-14T11:31:02.572Z","updated_at":"2026-05-04T11:37:49.096Z","avatar_url":"https://github.com/owainkenwayucl.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fractals\n\n## Generic Python code for generating and exploring fractals\n\nI have a lot of repos on Github for generating Mandelbrot sets (e.g. [various languages](https://github.com/owainkenwayucl/mandel), [OpenWatcom Fortran 77 for DOS](https://github.com/owainkenwayucl/mandel77), [FreeBASIC](https://github.com/owainkenwayucl/mandbas)) but those implementations have very rigidly stuck to a fairly inflexible way of doing things, don't use built in complex types etc.  The code in this repository for Python is designed to be a lot more flexible (but probably a lot slower) to test out some concepts for doing things.\n\n## Goals\n\n * generic to do more than Mandelbrot, e.g. Julia sets [done]\n * use complex types [done]\n * use numpy where possible [ongoing]\n * graphical [done] and image output [done]\n * parallelisation\n\n ## Examples\n\n If you look in `mandelbrot.py` you will see a fairly normal Mandelbrot example.\n\n ```python\nimport fractals\n\nfractals.show_image(fractals.generate_fractal(600,400, fractals.mandel, max_iter=50))\n ```\n\n This example illustrates where I am trying to go - you generically show an image based on the output of a procedure that generates a fractal image of a given size given a function (in this case the one for the Mandelbrot set) and a number of iterations (optional).\n\n![Output of mandelbrot.py](img/mandel.png)\n\nIf you look in `julia.py` you can see an example which generates and displays one after another the example Julia sets shown on [Wikipedia](https://en.wikipedia.org/wiki/Julia_set#Examples_of_Julia_sets).\n\n```python\nimport fractals\n\n# Generate julia sets as per https://en.wikipedia.org/wiki/Julia_set#Examples_of_Julia_sets\n\nn = 2\nc = [0.279, 0.400, 0.484, 0.544, 0.590, 0.626]\nfor i in c: \n    j = fractals.generate_julia(i,n)\n    fractals.show_image(fractals.generate_fractal(600,600, j, max_iter=50, xmin=-2.0, xmax=2.0, ymin=-2.0, ymax=2.0))\n    n += 1\n```\n\nHere we can see an example where in order to allow arbitrary values in Julia functions, I have implemented a generic function `fractals.julia` and then written `fractals.generate_julia` which takes values of *c* and *n* and generates and returns an anonymous function based on `fractals.julia` which is based on those values so that it may be safely passed to `fractals.generate_fractal`.\n\n![First output of julia.py](img/julia1.png)\n\nThe procedure `fractals.show_image` uses tkinter to display the image.  There is also a procedure `fractals.show_image_matplotlib` which uses Matplotlib to display the image.  The examples `mandelbrot-mpl.py` and `julia-mpl.py` use this method.\n\n![Matplotlib screenshot](img/mandel2.png)\n\nYou can of course then save the plot from Matplotlib.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fowainkenwayucl%2Ffractals","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fowainkenwayucl%2Ffractals","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fowainkenwayucl%2Ffractals/lists"}