{"id":17030253,"url":"https://github.com/vsoch/juliart","last_synced_at":"2025-04-12T12:12:37.001Z","repository":{"id":57438233,"uuid":"230142089","full_name":"vsoch/juliart","owner":"vsoch","description":"module for generating Julia Set artwork","archived":false,"fork":false,"pushed_at":"2019-12-29T21:15:52.000Z","size":100440,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T12:12:12.612Z","etag":null,"topics":["fractal","generator","juliaset"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vsoch.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-25T18:55:29.000Z","updated_at":"2021-09-10T15:54:56.000Z","dependencies_parsed_at":"2022-08-29T03:01:38.273Z","dependency_job_id":null,"html_url":"https://github.com/vsoch/juliart","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/vsoch%2Fjuliart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsoch%2Fjuliart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsoch%2Fjuliart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsoch%2Fjuliart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vsoch","download_url":"https://codeload.github.com/vsoch/juliart/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248565079,"owners_count":21125417,"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":["fractal","generator","juliaset"],"created_at":"2024-10-14T08:05:27.261Z","updated_at":"2025-04-12T12:12:36.978Z","avatar_url":"https://github.com/vsoch.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Julia Art \"juliart\"\n\n[![PyPI version](https://badge.fury.io/py/juliart.svg)](https://pypi.org/project/juliart/)\n[![GitHub actions status](https://github.com/vsoch/juliart/workflows/ci/badge.svg?branch=master)](https://github.com/vsoch/juliart/actions?query=branch%3Amaster+workflow%3Aci)\n\nThis module is based on the [Color Julia Bot](https://twitter.com/colorjulia_bot)\nbut intended for command line generation, and with options to customize colors\nbased on themes (holidays, seasons) and also generate animations. \nThe name \"juliart\" is also a play on word (Juliard) to hint\nat artsy things.\n\n![img/juliart.png](https://raw.githubusercontent.com/vsoch/juliart/master/img/juliart.png)\n\nI've done my best so that the default parameters produce (what I think to be)\nthe most random and pretty images. You can of course tweak the parameters\nto your liking, discussed below!\n\n## Examples and Documentation\n\nIf you want to jump in to examples, see these repositories:\n\n - [vsoch/juliart-says](https://github.com/vsoch/juliart-says): write Markov generated (or raw) text onto a Julia Set image\n - [vsoch/juliart-grid](https://github.com/vsoch/juliart-grid): a grid of Julia Sets to show indexing into the Mandelbrot Set\n - [vsoch.github.io](https://vsoch.github.io/2019/juliart/): A writeup of Juliart, explaining Julia and Mandelbrot sets.\n\n\n## Usage\n\n### Install\n\nYou can install from pypi\n\n```bash\npip install juliart\n```\n\nor install from the repository directly:\n\n```bash\n$ git clone https://github.com/vsoch/juliart\n$ python setup.py install\n```\n\nfor animations you'll also need an extra package:\n\n```bash\npip install juliart[animate]\n```\n\n### Generate Art\n\nYou can see basic usage by typing `juliart` into your terminal:\n\n```bash\n$ juliart\nusage: juliart [-h] [--version] {generate,animate} ...\n\nJulia Set art generator\n\noptional arguments:\n  -h, --help          show this help message and exit\n  --version           suppress additional output.\n\nactions:\n  actions for Julia Set art generator\n\n  {generate,animate}  juliart actions\n    generate          generate a Julia Set image\n    animate           create a Julia Set animation (gif)\n```\n\nYou'll see there are two options: to generate, and to animate. \n\n\n#### Generate\n\nCustomizations for the generate command generally include color or theme choices,\nan optional text to print on the graphic, and parameters.\n\n\n```bash\n$ juliart generate --help\nusage: juliart generate [-h] [--radius RADIUS] [--outfile OUTFILE]\n                        [--text TEXT] [--fontsize FONTSIZE] [--xcoord XCOORD]\n                        [--ycoord YCOORD] [--ca CA] [--cb CB] [--res RES]\n                        [--iter ITERS] [--color {random,pattern,glow}]\n                        [--rgb RGB]\n                        [--theme {christmas,easter,fall,random,halloween,hanukkah,spring,summer,thanksgiving,valentine,winter}]\n                        [--zoom ZOOM]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --radius RADIUS       the max radius to allow (default is 4)\n  --outfile OUTFILE     the output file to save the image (defaults to\n                        randomly generated png)\n  --text TEXT           write a string of text to bottom left corner\n  --fontsize FONTSIZE   font size of text (if desired) defaults to 16\n  --xcoord XCOORD       x coordinate for text (defaults to 0)\n  --ycoord YCOORD       y coordinate for text (defaults to 0)\n  --ca CA               the a component of the c parameter\n  --cb CB               the b component of the c parameter\n  --res RES             the resolution to generate (defaults to 1000)\n  --iter ITERS          the number of iterations per pixel (defaults to 200)\n  --color {random,pattern,glow}\n                        a color pattern to follow.\n  --rgb RGB             a specific rbg color, in format R,G,B\n  --theme {christmas,easter,fall,random,halloween,hanukkah,spring,summer,thanksgiving,valentine,winter}\n                        a theme to color the art (defaults to random colors)\n  --zoom ZOOM           the level of zoom (defaults to 1.8)\n```\n\n##### Defaults\n\nIf you use the defaults, it will generate a randomly named image in your\npresent working directory.\n\n```bash\n$ juliart generate\nGenerating Julia Set...\nSaving image to doopy-kerfuffle-5780.png\n```\n\n##### C Parameters\n\nThe values of ca and cb (the real and complex components of the c parameter\nin the Julia Set equation) are chosen at random, but you can select them\nto better understand how your choices influence the graphic generation:\n\n```bash\njuliart generate --ca 0.5 --cb 0.5\n```\n\nI also created a [small project](https://github.com/vsoch/juliart-grid/) that will visually show how your parameter selection\ninfluences the resulting image! You might want to give the output file a more meaningful name:\n\n```bash\njuliart generate --ca 0.5 --cb 0.5 --outfile ca-0.5-cb-0.5.png\n```\n\nAnd if you intend to compare the images, setting a consistent color is also \nreasonable:\n\n```bash\njuliart generate --ca 0.5 --cb 0.5 --outfile ca-0.5-cb-0.5.png --rgb 90,12,10\n```\n\nFor a bigger deep dive into this exercise (I was curious) see [Juliart Grid](https://github.com/vsoch/juliart-grid).\n\n\n##### Text\n\nAs an alternative to file name (or just to have some fun!) you can generate\nan image with a custom message.\n\n```bash\njuliart generate --text \"Dinosaurs are great!\"\n```\n\nBy default the text will be printed in the top left corner (coordinate 10,10)\nhowever you can adjust this to your liking:\n\n```bash\n$ juliart generate --text \"Avocados are also great!\" --xcoord 200 --ycoord 20\n```\n\nYou can also change the font from OpenSans-Regular.ttf to Pacifico-Regular.ttf,\nand choose an alpha (transparency).\n\n```bash\n$ juliart generate --text \"Avocados!\" --fontsize 30 --font-alpha 90 --font Pacifico-Regular\n```\n\nYou can see all of these examples in the [text](img/text) examples folder.\n\n\n##### Zoom, Iterations, and Radius\n\nOtherwise you can do any of the customizations shown above! Try playing\naround with iterations, colors/themes, and zoom to see different effects.\n\n```bash\n$ juliart generate --zoom 3\n$ juliart generate --iter 100\n```\n\nAfter looking over the equation to generate the JuliaSet for a while,\nI got the insight that if we increase the iterations value and modify the radious,\n this will generate more detailed images. Here are some examples:\n\n```bash\njuliart generate --iter 1000 --radius 8\n```\n\n![img/random/frigid-kitty-0005.png](https://raw.githubusercontent.com/vsoch/juliart/master/img/random/frigid-kitty-0005.png)\n\n```bash\njuliart generate --iter 5000 --radius 10\n```\n\nThis one takes longer, of course.\n\n##### Interactive Python\n\nTo generate from within Python, here is a quick example:\n\n```python\nfrom juliart.main import JuliaSet\n\njuliaset = JuliaSet(\n    resolution=1000, # (1000x1000)\n    color=\"random\", # random, glow, pattern\n    theme=\"random\",\n    rgb=None,  # \"197,18,12\"\n    iterations=200,\n)\njuliaset.generate_image(zoom=1.8)\njuliaset.save_image(\"/tmp/myimage.png\")\n```\n\nIf you want to add text, before the save_image do:\n\n```python\njuliaset.write_text(\n    text,\n    fontsize=16,\n    xcoord=10,\n    ycoord=10,\n)\n```\n\nBy default, the text is white. You can change the color (and add a transparency, alpha layer)\nlike:\n\n\n```python\njuliaset.write_text(\n    text,\n    fontsize=16,\n    xcoord=10,\n    ycoord=10,\n    rgb=(255, 255, 255, 15),\n)\n```\n\n#### Animate\n\n![img/animate/butterscotch-plant-7505.gif](https://raw.githubusercontent.com/vsoch/juliart/master/img/animate/butterscotch-plant-7505.gif)\n\nYou can inspect the parameters for the animation command as follows:\n\n```bash\n$ juliart animate --help\nusage: juliart animate [-h] [--no-cleanup] [--constant-a] [--constant-b]\n                       [--randomize-zoom] [--zoom-max ZOOM_MAX]\n                       [--zoom-min ZOOM_MIN] [--frames FRAMES]\n                       [--outfile OUTFILE] [--text TEXT] [--fontsize FONTSIZE]\n                       [--xcoord XCOORD] [--ycoord YCOORD] [--ca CA] [--cb CB]\n                       [--res RES] [--iter ITERS]\n                       [--color {random,pattern,glow}] [--rgb RGB]\n                       [--theme {christmas,easter,fall,random,halloween,hanukkah,spring,summer,thanksgiving,valentine,winter}]\n                       [--zoom ZOOM]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --no-cleanup          Do not delete temporary directory with png files to\n                        generate gif.\n  --constant-a          Don't randomize the point A on the circle.\n  --constant-b          Don't randomize the point B on the circle.\n  --randomize-zoom      Randomize the zoom up to --zoom-min or --zoom-max.\n  --zoom-max ZOOM_MAX   the max zoom (must be greater than 3)\n  --zoom-min ZOOM_MIN   the max zoom (must be greater than 0)\n  --frames FRAMES       the number of frames to generate (default is 30)\n  --outfile OUTFILE     the output file to save the image (defaults to\n                        randomly generated png)\n  --text TEXT           write a string of text to bottom left corner\n  --fontsize FONTSIZE   font size of text (if desired) defaults to 16\n  --xcoord XCOORD       x coordinate for text (defaults to 0)\n  --ycoord YCOORD       y coordinate for text (defaults to 0)\n  --ca CA               the a component of the c parameter\n  --cb CB               the b component of the c parameter\n  --res RES             the resolution to generate (defaults to 1000)\n  --iter ITERS          the number of iterations per pixel (defaults to 200)\n  --color {random,pattern,glow}\n                        a color pattern to follow.\n  --rgb RGB             a specific rbg color, in format R,G,B\n  --theme {christmas,easter,fall,random,halloween,hanukkah,spring,summer,thanksgiving,valentine,winter}\n                        a theme to color the art (defaults to random colors)\n  --zoom ZOOM           the level of zoom (defaults to 1.8)\n```\n\nMost of these defaults (mins and maxes) are fairly reasonable and you wouldn't\nwant to change them. By default, we will vary both the A and B constants that\nare used to generate the Julia Set, but we won't vary the zoom. \n\n##### Defaults\n\nThe defaults will generate a 30 framed animation, varying the parameters\nA and B but not the zoom, with resolution (1000 X 1000) and 200 iterations.\n\n```bash\n$ juliart animate --frames 5\n```\n\n##### Optimize \n\nYou can make that faster by changing the iterations and resolution, of course!\n\n```bash\n$ juliart animate --res 500 --iters 100\n```\n\nThe tradeoff is image quality. You'll also notice in the case of generating\nblack pixels it takes slightly longer than white pixels (since white is \nan absence of color).\n\n##### Text\n\nYou can add a consistent message to all frames in an animation:\n\n```bash\njuliart animate --text \"Dinosaurs are great!\"\n```\n\nand customize the `--xcoord`, `--ycoord`, or `--fontsize` parameters as\ndesired. See the [text](img/text) examples folder for an example. If you want\nto vary the text between frames, then you'll need to roll your own\nloop to generate the frames and then combine into an animation. An example\nis provided, the code at [Juliart Grid](https://github.com/vsoch/juliart-grid).\n\n\n##### Cleanup\n\nIf you want to keep the temporary png images (the frames) you can do:\n\n```bash\n$ juliart animate --no-cleanup\n```\n\n##### Frames\n\nIf you want to customize the number of frames, you can do that too (we default to 30). Here\nwould be a smaller / quicker to generate image:\n\n```bash\n$ juliart animate --frames 5\n```\n\n##### Zoom\n\nTo also randomize the zoom, specify:\n\n```bash\n$ juliart animate --randomize-zoom --frames 5\n```\n\n##### Python\n\nTo generate from within Python, it's fairly straight forward:\n\n```python\nfrom juliart.main import JuliaSetAnimation\n\njuliaset = JuliaSetAnimation(\n    resolution=args.res,\n    color=args.color,\n    theme=args.theme,\n    rgb=args.rgb,\n    cleanup=not args.skip_cleanup,\n    iterations=args.iters,\n    zoom_max=args.zoom_max,\n    zoom_min=args.zoom_min,\n)\n\njuliaset.generate_animation(\n    zoom=args.zoom,\n    outfile=args.outfile,\n    frames=args.frames,\n    randomize_a=not args.constant_a,\n    randomize_b=not args.constant_b,\n    randomize_zoom=args.randomize_zoom,\n)\n```\n\n\n### Colors\n\nThe three choices for colors are random, pattern, or glow, or setting your\nown RGB value.\n\n#### Random\n\nRandom is the default, and the image at the top of the README here is generated using\nthis setting. Take a look at more [more random examples](https://github.com/vsoch/juliart/tree/master/img/random).\n\n#### Pattern\n\nPattern doesn't use a gradual gradient, but instead returns a hard boundary between\na color (and black). \n\n![img/pattern/delicious-lizard-8995.png](https://raw.githubusercontent.com/vsoch/juliart/master/img/pattern/delicious-lizard-8995.png)\n\nTake a look at more [more pattern examples](https://github.com/vsoch/juliart/tree/master/img/pattern) here.\n\n### RGB\n\nIf you want complete control of the color, provide a comma separated list\nof RGB numbers as follows:\n\n```bash\n$ juliart generate --rgb 9,35,155\n```\n\nNote that this will also work with the `--color pattern` flag.\n\n#### Glow\n\nGlow means a dark background (black) with a color gradient. Here is an example:\n\n![img/glow/dinosaur-diablo-1189.png](https://raw.githubusercontent.com/vsoch/juliart/master/img/glow/dinosaur-diablo-1189.png)\n\nAnd is generated as follows:\n\n```bash\njuliart generate --color glow\n```\n\nSee [more glow examples](https://github.com/vsoch/juliart/tree/master/img/glow).\n\nIf you choose glow, this will overwrite the choice of a theme (discussed next).\n\n### Themes\n\nTo get a little more variety in your choice of colors, you can select a theme! \n\n```bash\njuliart generate --theme halloween\njuliart generate --theme christmas\njuliart generate --theme hanukkah\njuliart generate --theme thanksgiving\njuliart generate --theme valentine\n\njuliart generate --theme easter\njuliart generate --theme fall\njuliart generate --theme spring\njuliart generate --theme summer\njuliart generate --theme winter\n```\n\nFor any of the commands above, you can also add `--color pattern` to flip the background\nfrom the theme color to be black. \n\n```bash\n$ juliart generate --theme halloween --color pattern\n```\n\nTake a look at images in the [themes folder](https://github.com/vsoch/juliart/tree/master/img/pattern) \nto get a sense of the color palettes.\n\n### Docker\n\nYou can run the pre-generated Docker container too! You'll need to bind a folder\non the host to save the image to.\n\n```bash\n$ mkdir data\n$ docker run -it -v $PWD/data/:/data quay.io/vanessa/juliart generate --outfile /data/art.png\n```\n\nYou can also build the image first if you like:\n\n```bash\n$ docker build -t quay.io/vanessa/juliart .\n```\n\nThe images are provided on [quay.io/vanessa/juliart](https://quay.io/repository/vanessa/juliart).\n\n## Support\n\nDo you have a question? Or want to suggest a feature to make it better?\nPlease [open an issue!](https://www.github.com/vsoch/juliart)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvsoch%2Fjuliart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvsoch%2Fjuliart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvsoch%2Fjuliart/lists"}