Extra Credit - Generative Art with {aRtsy}

Getting Started 🎬

1.) Head to Posit Cloud

2.) Click “Get Started”

3.) Under “Cloud Free” click Learn more

4.) Click Sign Up then fill out the form

5.) Verify your email

6.) Once your in the posit Cloud, click “New Project”

7.) Then “New RStudio Project”

Install {aRtsy} 💻

Write in the code below:

install.packages("aRtsy")

You have to write it in, you cannot copy and paste.

The install will take time to run, so wait until the red stop sign in the corner disappears

A bunch of computer thinking 🤖 will appear like below

Load {aRtsy} 📦

Once you finish installing, copy and paste this code below into the console and hit enter

library(aRtsy)

Here is the fun part 🎨

Pick any one of the code chunks below (i.e., Cobwebs, Collatz conjecture, Fractal flames, Rainbow smoke, Lissajous curves), copy and paste it into the console. Then hit enter. Your artwork will appear to the right like the image below. Be sure to give it a minute or two.

Tip

You can simply edit the value inside the set.seed(this number here) and hit enter. Although there are other options to. Feel free to explore.

Colors

Anywhere in the code where you see: colors = colorPalette(““), you can add a different color palette.

Try some of these:

azul, boogy1, boogy2, boogy3, gogh, jasp, nature, retro1, tuscany1, tuscany2, tuscany3, sky

Just make sure there are ” ” around the word.

Iterations

The iteration parameter can take a long time to run or cause a crash if it’s set too high. If it does crash, just close the program and try again-no harm done.

Cobwebs

set.seed(1) # place any number between the ( )
canvas_cobweb(colors = colorPalette("sky"),
               background = "white", # you can try black, blue, orange
               lines = 200, # the number of lines to draw
               iterations = 300) # the number of iterations of the algorithm 

Collatz conjecture

set.seed(1)  # place any number between the ( )
canvas_collatz(colors = colorPalette("tuscany3"),
               n = 700, # a positive integer, adds more density or lines, computational dependent though (keep under 1000)
               side = FALSE) # If this is true it will flip to side

Fractal flames

set.seed(1)      # place any number between the ( )
canvas_flame(colors = colorPalette("dark2"),
             iterations = 1000000,   # Using more iterations results in images of higher quality but also increases the computation time
             symmetry = 0,
              blend = TRUE,
             resolution = 1000,  #  resolution of the artwork in pixels per row/column
             gamma = 5  # Larger values here make the image brighter 
             )

Rainbow smoke

set.seed(1) # place any number between the ( )
canvas_smoke(colors = colorPalette("nature"),
             init = 1,
             resolution = 150, # Increasing this, increases the quality of the artwork but also increases the computation time 
             shape = "cloud"  # can also try "smoke"
             )

Lissajous curves

set.seed(1) # place any number between the ( )
canvas_lissajous(colors = colorPalette("retro1"),
                 background = "#000000",
                 iterations = 2, # the number of iterations of the algorithm
                 neighbors = 100, # number of connection or density
                 noise = FALSE)

Once you like your work 📸

Hit “export” and save as image and follow the remaining directions. Or just right click and do it that way.

Submit 📫

Once you have created your artwork, submit it on canvas.

References 📖

aRtsy: Generative Art with R and ggplot2