-
Notifications
You must be signed in to change notification settings - Fork 0
/
curating-art.Rmd
177 lines (137 loc) · 6.15 KB
/
curating-art.Rmd
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
---
title: "Curating the art"
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
options(
arttools.bucket.remote = "https://storage.googleapis.com/djnavarro-art",
arttools.repos.remote = "https://github.com/djnavarro"
)
```
```{r setup}
library(arttools)
options(
arttools.repos.local = file.path(tempdir(), "temp_repos"),
arttools.bucket.local = file.path(tempdir(), "temp_bucket")
)
```
```{r, include = FALSE}
repo_create(series = "series-fake", license = "ccby")
suppressMessages(
source(
file = fs::path_package(
"arttools",
"templates",
"common.R"
),
echo = FALSE
)
)
source_modified <- function(file) {
src_path <- fs::path_package("arttools", "templates", file)
src <- brio::read_lines(src_path)
src <- gsub(
pattern = "output_path(name, version, seed, format)",
replacement = paste0(
"output_path(name, version, seed, format, output_dir = '",
repo_local_path("series-fake", "output"),
"')"
),
src,
fixed = TRUE
)
src <- gsub(
pattern = 'source(here::here("source", "common.R"), echo = FALSE)',
replacement = "",
src,
fixed = TRUE
)
tmp <- tempfile(file)
brio::write_lines(src, tmp)
source(tmp)
}
source_modified("art-system_01.R")
source_modified("art-system_02.R")
```
So now we are at the point where we've finished making art and we want to wrap it all up, create a nice "curated" version of the output, and prepare it for publication. At this point we might have something that looks like this:
```{r}
#| echo: false
fs::dir_tree(repo_local_path("series-fake"), all = TRUE, recurse = TRUE)
```
Obviously, in real life you probably have more versions of the system and more outputs from each system, but this will suffice to illustrate how the process works.
### Regarding curation
Curation is mostly a manual process. Generative art systems don't always create images that I find pleasing, and I see no reason to publish the bad ones. There's an aesthetic I want to preserve when I publish a generative art series, and I view the "human in the loop" aspect to manual curation as an important part of the artistic process. Not everyone agrees with me on this, but after some years of making generative art that's where I've ended up.
Given that ethos, arttools implicitly assumes that you're going to choose a small subset of the uncurated images in the `[local-repos]/series-fake/output` folder and copy them into the `[local-bucket]/series-fake` folder. This manually curated subset is the one that you will want to publish to the web. That being said, there's nothing stopping you from copying every single output into your bucket and publishing the whole thing!
### Creating the curated version
Okay, let's turn to the practicalities, and assume you've chosen some images that you like and you've copied them across to the `series-fake` local bucket folder. So now you have something like this in your local bucket:
```{r}
#| echo: false
target_dir <- bucket_local_path("series-fake", "image")
fs::dir_create(target_dir)
keep <- c("art-system_01_0002.png", "art-system_01_0003.png")
fs::file_copy(
repo_local_path("series-fake", "output", "01", keep),
bucket_local_path("series-fake", "image", keep)
)
keep <- c("art-system_02_0003.png", "art-system_02_0005.png")
fs::file_copy(
repo_local_path("series-fake", "output", "02", keep),
bucket_local_path("series-fake", "image", keep)
)
fs::dir_tree(bucket_local_path("series-fake"), all = TRUE, recurse = TRUE)
```
Notice that for the curated version in the `series-fake` bucket, I've placed the images in an `image` folder. The reason for that is that -- usually -- the images you create with your generative art system are high resolution, so you're going to want to have low-res versions of the same images that you can use as "thumbnail" previews on your generative art website.
### Creating thumbnail images
The arttools package supplies a function to create all your thumbnails for you, boringly entitled `create_resized_images()`.
```{r}
#| eval: true
create_resized_images(
series = "series-fake",
images_from = "image",
images_to = "preview",
pixels_wide = 500,
pixels_high = 500,
origin = bucket_local_path()
)
```
The bucket now contains the "full resolution" images in the `image` folder, and lower resolution versions of the same images in the `preview` folder:
```{r}
#| echo: false
fs::dir_tree(bucket_local_path("series-fake"), all = TRUE, recurse = TRUE)
```
### Creating manifest files
At the moment, the `series-fake` bucket exists only as a local folder, and it's easy enough to inspect its contents. However, when it goes online to the remote bucket, it's not as easy to list all the contents automatically. To make life easier it's helpful to write a **manifest** file that lists all the files in the bucket. To that end, the arttools package has a function called `manifest_write()` that will create the file we need:
```{r}
manifest_write("series-fake")
```
And now we have a `manifest.csv` file:
```{r}
#| echo: false
fs::dir_tree(bucket_local_path("series-fake"), all = TRUE, recurse = TRUE)
```
Here's what it looks like:
```{r}
manifest_read("series-fake", origin = bucket_local_path())
```
At this point we have a nicely prepared folder full of curated artwork that we can upload to the remote bucket.
<!--
### System name changes
It's grossly typical that we choose a new name at the end of the process. Solution to this is to make it "superficial only". That is:
- Don't rename source files
- Don't rename the system ids etc within source files
- Don't rename the output file
But we:
- Do rename the repository on github (e.g., from `series-rectangles` to `series-subdivision`)
- Do rename the gallery folder (again, e.g., from `series-rectangles` to `series-subdivision`)
- Use the new name in the `_gallery.csv` file
It's not ideal, but it minimises mess, and ultimately ensures that the thing that gets published uses the correct name on the art website and on github. It also has the nice property of preserving redirects on github.
-->
```{r}
#| echo: false
#| results: hide
fs::dir_delete(repo_local_path("series-fake"))
fs::dir_delete(bucket_local_path("series-fake"))
```