-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerative_art.R
More file actions
77 lines (68 loc) · 2.29 KB
/
generative_art.R
File metadata and controls
77 lines (68 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
library(generativeart) # devtools::install_github("cutterkom/generativeart")
library(ambient)
library(dplyr)# set the paths
DIR <- "/home/alex/R/projekte/git/generative_art/"
# set the paths
IMG_DIR <- "/home/alex/R/projekte/git/generative_art/img/"
IMG_SUBDIR <- "everything/"
IMG_SUBDIR2 <- "handpicked/"
IMG_PATH <- paste0(IMG_DIR, IMG_SUBDIR)
LOGFILE_DIR <- "/home/alex/R/projekte/git/generative_art/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, 10) * x_i^2 + sin(y_i^2)),
y = quote(runif(1, -1, 10) * x_i^2 + cos(y_i^3))
#x = quote(runif(1, -1, 10) * x_i^2 - sin(y_i^2)),
#y = quote(runif(1, -1, 10) * y_i^3 +cos(x_i^3))
#x = quote(runif(1, -1, 10) * x_i^2 - sin(y_i^2)),
#y = quote(runif(1, -1, 10) * y_i^3 - cos(x_i^2) ) * y_i^4)
)# call the main function to create five images with a polar coordinate system
generativeart::generate_img(formula = my_formula,
nr_of_img = 5, # set the number of iterations
polar = FALSE,
filetype = "png",
color = "#43085F", #"#1b2e3c", #"#c1a06e",
background_color = "#DCC58D" # "#1a3657"
)
library(dplyr)
library(jasmines)
use_seed(1) %>%
entity_gaussian(grain = 300) %>%
unfold_tempest(iterations = 10) %>%
unfold_tempest(
iterations = 5,
scale = .01
) %>%
unfold_warp(
iterations = 1,
scale = .5,
output = "layer"
) %>%
style_ribbon(background = "wheat")
use_seed(1) %>%
entity_gaussian(grain = 10) %>%
#unfold_tempest(iterations = 10) %>%
unfold_tempest(
iterations = 5,
scale = .01
) %>%
unfold_warp(
) %>%
style_ribbon(background = "wheat")
ggsave("jasmines/p1.png", p0, width = 20, height = 20, units = "in")
library(flametree)
# pick some colours
shades <- c("#1b2e3c", "#0c0c1e", "#74112f", "#f3e3e2")
# data structure defining the trees
dat <- flametree_grow(time = 8, trees = 10)
# draw the plot
dat %>%
flametree_plot(
background = "antiquewhite",
palette = shades,
style = "nativeflora"
)