All Projects → cutterkom → Generativeart

cutterkom / Generativeart

Licence: gpl-3.0
Create Generative Art with R

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to Generativeart

interactive-plants
Generative plants and flowers.
Stars: ✭ 21 (-93.48%)
Mutual labels:  generative-art
canon-generator
Canon-generator: algorithmic composition using music21 and python
Stars: ✭ 19 (-94.1%)
Mutual labels:  generative-art
Sand Spline
generative algorithm
Stars: ✭ 261 (-18.94%)
Mutual labels:  generative-art
tweegeemee
Twitter Genetic Algorithm Imagery
Stars: ✭ 83 (-74.22%)
Mutual labels:  generative-art
frameV
Framed Visuals: collaborative generative art.
Stars: ✭ 20 (-93.79%)
Mutual labels:  generative-art
desert
A fast (?) random sampling drawing library
Stars: ✭ 61 (-81.06%)
Mutual labels:  generative-art
samila
Generative Art Generator
Stars: ✭ 750 (+132.92%)
Mutual labels:  generative-art
Context Free
Context Free is a program that generates images from written instructions called a grammar. The program follows the instructions in a few seconds to create images that can contain millions of shapes.
Stars: ✭ 326 (+1.24%)
Mutual labels:  generative-art
nft-generator-py
Unique image & metadata generation using weighted layer collections.
Stars: ✭ 127 (-60.56%)
Mutual labels:  generative-art
Artline
A Deep Learning based project for creating line art portraits.
Stars: ✭ 3,061 (+850.62%)
Mutual labels:  generative-art
Generative-Art-Sketches
A Generative Art Gallery with the idea of creating a virtual Art Gallery with my creations. I have tried my hands on creating some visually appealing art using Cellular Automata, Recursive Grammar, Phyllotaxis, Sandpiles, Perlin Noise, IFS, Tiling.
Stars: ✭ 24 (-92.55%)
Mutual labels:  generative-art
lines
A plotter-friendly 3D engine
Stars: ✭ 40 (-87.58%)
Mutual labels:  generative-art
VQGAN-CLIP-Docker
Zero-Shot Text-to-Image Generation VQGAN+CLIP Dockerized
Stars: ✭ 58 (-81.99%)
Mutual labels:  generative-art
vpype-pixelart
Pixel art plotting in vpype
Stars: ✭ 40 (-87.58%)
Mutual labels:  generative-art
Csound Expression
Haskell Framework for Electronic Music
Stars: ✭ 257 (-20.19%)
Mutual labels:  generative-art
random-art-generator
Command-line application to produce generative art based on a target image
Stars: ✭ 32 (-90.06%)
Mutual labels:  generative-art
glitch-image
🖼 Generate and save unique glitchy images
Stars: ✭ 46 (-85.71%)
Mutual labels:  generative-art
Generativeart
Generative Art in Go
Stars: ✭ 313 (-2.8%)
Mutual labels:  generative-art
Vpype
The Swiss-Army-knife command-line tool for plotter vector graphics.
Stars: ✭ 292 (-9.32%)
Mutual labels:  generative-art
pencil-scribbles
Create pencil effect drawings from pictures using R
Stars: ✭ 30 (-90.68%)
Mutual labels:  generative-art

generativeart

Create Generative Art with R.

More on Instagram

Description

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. -- Why Love Generative Art? - Artnome

The R package generativeart let's you create images based on many thousand points. The position of every single point is calculated by a formula, which has random parameters. Because of the random numbers, every image looks different.

In order to make an image reproducible, generative art implements a log file that saves the file_name, the seed and the formula.

Install

You can install the package with the devtools package directly from Github:

devtools::install_github("cutterkom/generativeart")

generativeart uses the packages ggplot2, magrittr, purrr and dplyr.

Usage

The package works with a specific directory structure that fits my needs best. The first step is to create it with setup_directories(). All images are saved by default in img/everything/. I use img/handpicked/ to choose the best ones. In logfile/ you will find a csv file that saves the file_name, the seed and the used formula.

library(generativeart)

# set the paths
IMG_DIR <- "img/"
IMG_SUBDIR <- "everything/"
IMG_SUBDIR2 <- "handpicked/"
IMG_PATH <- paste0(IMG_DIR, IMG_SUBDIR)

LOGFILE_DIR <- "logfile/"
LOGFILE <- "logfile.csv"
LOGFILE_PATH <- paste0(LOGFILE_DIR, LOGFILE)

# create the directory structure
generativeart::setup_directories(IMG_DIR, IMG_SUBDIR, IMG_SUBDIR2, LOGFILE_DIR)

# include a specific formula, for example:
my_formula <- list(
  x = quote(runif(1, -1, 1) * x_i^2 - sin(y_i^2)),
  y = quote(runif(1, -1, 1) * y_i^3 - cos(x_i^2))
)

# call the main function to create five images with a polar coordinate system
generativeart::generate_img(formula = my_formula, nr_of_img = 5, polar = TRUE, filetype = "png", color = "black", background_color = "white")

  • You can create as many images as you want by setting nr_of_img.
  • For every image a seed is drawn from a number between 1 and 10000.
  • This seed determines the random numbers in the formula.
  • You can choose between cartesian and polar coordinate systems by setting polar = TRUE or polar = FALSE
  • You can choose the colors with color = 'black' and background_color = 'hotpink'
  • You can save the output image in various formats. Default is png, the alternatives are defined by the device options of ggplot::ggsave().
  • the formula is a list()

Examples

It 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:

my_formula <- list(
  x = quote(runif(1, -1, 1) * x_i^2 - sin(y_i^2)),
  y = quote(runif(1, -1, 1) * y_i^3 - cos(x_i^2))
)

generativeart::generate_img(formula = my_formula, nr_of_img = 5, polar = TRUE, color = "black", background_color = "white")

Two possible images:

seed = 1821, polar = TRUE:

seed = 5451, polar = FALSE:

The corresponding log file looks like that:

file_name seed formula_x formula_y
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)
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)

Inspiration

The basic concept is heavily inspired by Fronkonstin's great blog.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].