Skip to content

Commit

Permalink
Combine 6 configs to support a blog post
Browse files Browse the repository at this point in the history
  • Loading branch information
jennybc committed Sep 11, 2021
1 parent c4e1de1 commit 1ce9862
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions img/_combine-github-configs.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
library(magick)
library(here)
library(tidyverse)
library(fs)

paths <- here(
"img",
c("no_github.png", "ours-you.png", "ours-them.png",
"theirs.png", "fork-them.png", "fork-ours.png")
)

x <- paths %>% set_names(~ path_ext_remove(path_file(.x))) %>% map(image_read)
str(x)

dat <- tibble(
img = x,
anno = c("no_github", "ours (1 of 2)", "ours (2 of 2)",
"theirs", "fork (1 of 2)", "fork (2 of 2)")
)

sz <- 45
x_anno <- map2(
dat$img, dat$anno,
~image_annotate(.x, .y, size = sz, gravity = "northwest", location = "+25+25")
)

x_anno[[1]]
x_anno[[2]]
x_anno[[3]]
x_anno[[4]]
x_anno[[5]]
x_anno[[6]]

top_row <- x_anno %>%
head(3) %>%
image_join() %>%
image_scale("x200") %>%
image_append()
top_row
bot_row <- x_anno %>%
tail(3) %>%
image_join() %>%
image_scale("x200") %>%
image_append()
bot_row
all <- c(top_row, bot_row) %>% image_join() %>% image_append(stack = TRUE)
all

image_write(all, here("img", "six-configs.png"))
Binary file added img/six-configs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1ce9862

Please sign in to comment.