Getting started with generative art

Nicola Rennie

RSS Conference 2024

About Me


Academic background in statistics

Experience in data science consultancy

Lecturer in Health Data Science in Lancaster Medical School.

Research interests: healthcare data, reproducible research, data visualisation, R pedagogy…



Part 1

What is generative art?

What’s this talk about?




Getting started with generative art.

Are we talking about art made
with generative AI?



No.

Okay, so what is generative art?

Generative art:

  • a form of art that is created using algorithms, rules, or systems that are

  • often (but not always) executed by computers.

  • artist sets parameters and the system generates the artwork.

Generative art isn’t a new thing: Harold Cohen was considered one of the first practitioners of generative art in the 1960s.

Why should you care?

  • Practice designing algorithms (that are efficient).

  • Using functions and statistical methods in ways they weren’t designed for.

  • Get better at programming - especially functions that simulate data.

  • Improve the aesthetics of your data visualisations.

  • It’s fun!

How do you create a generative art system?

There are usually:

  • Parameters

  • Randomness

  • Rules

Activity 1

Identify the parameters, randomness, and rules:

Activity 1

Identify the parameters, randomness, and rules:



Part 2

Developing a generative art system

But I’m not an arty person, how do I get started?

Find some inspiration from things that already exist:

  • Generative systems that already exist e.g. R packages

  • Generative art that others have created (steal like an artist)

  • Non-generative art that others have created

  • Everyday things

Find some inspiration from people

Danielle Navarro: art.djnavarro.net/gallery

Find some inspiration from people

Claus Wilke: clauswilke.com/art

Find some inspiration from people

Meghan Harris: thetidytrekker.com/rtistry

Developing a system

Inspiration from everyday things:

Developing a system

Rules:

  • A series of horizontal lines
  • On each line, there are circles of varying sizes

Developing a system

Parameters:

  • Number of lines
  • Number of circles per line
  • Background colour and colour of circles

Developing a system

Randomness:

  • Position of circles on line
  • Size of the circles

Activity 2

In groups:

  • Find some inspiration
  • Define some rules
  • Define some randomness
  • Define some parameters


Slides: nrennie.rbind.io/rss-2024-generative-art



Part 3

Implementing generative systems

Reminder of our system

Rules:

  • A series of horizontal lines
  • On each line, there are circles of varying sizes

Parameters:

  • Number of lines
  • Number of circles per line
  • Background colour and colour of circles

Randomness:

  • Position of circles on line
  • Size of the circles

Define default parameters

n_lines <- 8
n_dots <- 10
max_size <- 3
main_col <- "black"
bg_col <- "white"
s <- 1234

Parameters:

  • Number of lines
  • Number of circles per line
  • Background colour and colour of circles

Simulate data

set.seed(s)
plot_data <- data.frame(
  x = stats::runif(n_lines * n_dots, 0, 10),
  y = rep(1:n_lines, n_dots),
  size = stats::rexp(n_lines * n_dots)
)
         x y       size
1 1.137034 1 0.05974751
2 6.222994 2 1.52295591
3 6.092747 3 0.84918014
4 6.233794 4 0.60822881
5 8.609154 5 1.20614573
6 6.403106 6 0.24495252

Plot the data

library(ggplot2)
g <- ggplot(
  data = plot_data,
  mapping = aes(x = x, y = y)
) +
  geom_line(aes(group = y),
    alpha = 0.1, colour = main_col,
    linewidth = 0.3
  ) +
  geom_point(aes(size = size),
    pch = 21,
    fill = main_col, colour = main_col,
    alpha = 0.3
  )
g

Adjust the styling

g +
  scale_size(range = c(0.3, max_size)) +
  theme_void() +
  theme(
    plot.background = element_rect(
      fill = bg_col, colour = bg_col
    ),
    legend.position = "none",
    plot.margin = unit(c(0, 0, 0, 0), "cm")
  )

Adjust the parameters

n_lines <- 30
n_dots <- 100
max_size <- 2
main_col <- "#326273"
bg_col <- "#BDD8DE"
s <- 2024

Activity 3

  • Go back to the rules, parameters, and randomness you defined in the previous activity.

  • Try to implement it:

    • using R (or another programming language)
    • or using paper

Slides: nrennie.rbind.io/rss-2024-generative-art

Statistic is both a science and an art.


nicola-rennie

nrennie

nrennie.rbind.io

QR code