{"id":13400495,"url":"https://github.com/cutterkom/generativeart","last_synced_at":"2025-04-12T20:41:57.482Z","repository":{"id":37617388,"uuid":"157725832","full_name":"cutterkom/generativeart","owner":"cutterkom","description":"Create Generative Art with R","archived":false,"fork":false,"pushed_at":"2022-04-27T07:53:49.000Z","size":10419,"stargazers_count":924,"open_issues_count":5,"forks_count":163,"subscribers_count":31,"default_branch":"master","last_synced_at":"2025-04-04T00:07:51.270Z","etag":null,"topics":["generative-art","generativeart","r"],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cutterkom.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}},"created_at":"2018-11-15T14:39:20.000Z","updated_at":"2025-03-19T00:34:51.000Z","dependencies_parsed_at":"2022-07-14T00:50:33.078Z","dependency_job_id":null,"html_url":"https://github.com/cutterkom/generativeart","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/cutterkom%2Fgenerativeart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cutterkom%2Fgenerativeart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cutterkom%2Fgenerativeart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cutterkom%2Fgenerativeart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cutterkom","download_url":"https://codeload.github.com/cutterkom/generativeart/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631668,"owners_count":21136554,"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":["generative-art","generativeart","r"],"created_at":"2024-07-30T19:00:52.625Z","updated_at":"2025-04-12T20:41:57.464Z","avatar_url":"https://github.com/cutterkom.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"# generativeart\n\n## Announcement\n\nThis package collects more and more stars here on Github and is widely used for NFTs. Just browse on NFT platforms - it won't take you long to discover  patterns be that might be decandents of this repository.\n\nI would like to clarify: I am **not a fan** of Blockchain, NFT and Web3. \n\nWhy? Read this text: [\"The Third Web\"](https://tante.cc/2021/12/17/the-third-web/) by [@tante](https://twitter.com/tante).\n\n--- \n\nCreate Generative Art with R.\n\n![](img/generativeart.png)\n\n[More on Instagram](https://www.instagram.com/cutterkom/)\n\n## Description\n\n\u003e One overly simple but useful definition is that generative art is art programmed using a computer that intentionally introduces randomness as part of its creation process.\n-- [Why Love Generative Art? - Artnome](https://www.artnome.com/news/2018/8/8/why-love-generative-art)\n\nThe `R` package `generativeart` let's you create images based on many thousand points.\nThe position of every single point is calculated by a formula, which has random parameters.\nBecause of the random numbers, every image looks different.\n\nIn order to make an image reproducible, `generative art` implements a log file that saves the `file_name`, the `seed` and the `formula`.\n\n## Install\n\nYou can install the package with the `devtools` package directly from Github:\n\n```r\ndevtools::install_github(\"cutterkom/generativeart\")\n```\n\n`generativeart` uses the packages `ggplot2`, `magrittr`, `purrr` and `dplyr`.\n\n## Usage\n\nThe package works with a specific directory structure that fits my needs best.\nThe first step is to create it with `setup_directories()`.\nAll images are saved by default in `img/everything/`. I use `img/handpicked/` to choose the best ones.\nIn `logfile/` you will find a `csv` file that saves the `file_name`, the `seed` and the used `formula`.\n\n```r\nlibrary(generativeart)\n\n# set the paths\nIMG_DIR \u003c- \"img/\"\nIMG_SUBDIR \u003c- \"everything/\"\nIMG_SUBDIR2 \u003c- \"handpicked/\"\nIMG_PATH \u003c- paste0(IMG_DIR, IMG_SUBDIR)\n\nLOGFILE_DIR \u003c- \"logfile/\"\nLOGFILE \u003c- \"logfile.csv\"\nLOGFILE_PATH \u003c- paste0(LOGFILE_DIR, LOGFILE)\n\n# create the directory structure\ngenerativeart::setup_directories(IMG_DIR, IMG_SUBDIR, IMG_SUBDIR2, LOGFILE_DIR)\n\n# include a specific formula, for example:\nmy_formula \u003c- list(\n  x = quote(runif(1, -1, 1) * x_i^2 - sin(y_i^2)),\n  y = quote(runif(1, -1, 1) * y_i^3 - cos(x_i^2))\n)\n\n# call the main function to create five images with a polar coordinate system\ngenerativeart::generate_img(formula = my_formula, nr_of_img = 5, polar = TRUE, filetype = \"png\", color = \"black\", background_color = \"white\")\n\n```\n\n* You can create as many images as you want by setting `nr_of_img`.\n* For every image a seed is drawn from a number between 1 and 10000.\n* This seed determines the random numbers in the formula.\n* You can choose between cartesian and polar coordinate systems by setting `polar = TRUE` or `polar = FALSE`\n* You can choose the colors with `color = 'black'` and `background_color = 'hotpink'`\n* You can save the output image in various formats.\nDefault is `png`, the alternatives are defined by the `device` options of [`ggplot::ggsave()`](https://ggplot2.tidyverse.org/reference/ggsave.html).\n* the formula is a `list()`\n\n## Examples\n\nIt is a good idea to use the sine and cosine in the formula, since it guarantees nice shapes, especially when combined with a polar coordinate system. One simple example:\n\n```r\nmy_formula \u003c- list(\n  x = quote(runif(1, -1, 1) * x_i^2 - sin(y_i^2)),\n  y = quote(runif(1, -1, 1) * y_i^3 - cos(x_i^2))\n)\n\ngenerativeart::generate_img(formula = my_formula, nr_of_img = 5, polar = TRUE, color = \"black\", background_color = \"white\")\n\n```\n\nTwo possible images:\n\n`seed = 1821`, `polar = TRUE`:\n![](img/2018-11-16-17-13_seed_1821.png)\n\n`seed = 5451`, `polar = FALSE`:\n![](img/2018-11-16-17-12_seed_5451.png)\n\nThe corresponding log file looks like that:\n\n| file_name                      | seed | formula_x                            | formula_y                            | \n|--------------------------------|------|--------------------------------------|--------------------------------------| \n| 2018-11-16-17-13_seed_1821.png | 1821 | runif(1, -1, 1) * x_i^2 - sin(y_i^2) | runif(1, -1, 1) * y_i^3 - cos(x_i^2) | \n| 2018-11-16-17-12_seed_5451.png | 5451 | runif(1, -1, 1) * x_i^2 - sin(y_i^2) | runif(1, -1, 1) * y_i^3 - cos(x_i^2) | \n\n\n## Inspiration\n\nThe basic concept is heavily inspired by [Fronkonstin's great blog](https://fronkonstin.com/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcutterkom%2Fgenerativeart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcutterkom%2Fgenerativeart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcutterkom%2Fgenerativeart/lists"}