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.

  1. read the code below and try it
  2. change the formula and generate your own artworks
  3. try to follow the package code on github
# install
#devtools::install_github("cutterkom/generativeart")

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
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 artworks
generate_img(formula = my_formula, nr_of_img = 3, polar = TRUE)
generate_img(formula = my_formula, nr_of_img = 3, polar = FALSE)