-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfg_fgtb_hex.qmd
More file actions
53 lines (44 loc) · 1.65 KB
/
fg_fgtb_hex.qmd
File metadata and controls
53 lines (44 loc) · 1.65 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
---
title: "fg_fgtb_hex"
format: html
---
---
```{r}
library(hexSticker)
library(magick)
```
```{r}
library(showtext)
## Loading Google fonts (http://www.google.com/fonts)
sysfonts::font_add_google(name = "Just Another Hand", family = "Just Another Hand")
## Automatically use showtext to render text for future devices
showtext::showtext_auto()
fg_fgtb_hex_image <- "images/pexels-donaldtong94-91505.jpg"
filename <- "FG_hexes/fg_fgtb_hex_image.png"
fg <- sticker(subplot = fg_fgtb_hex_image,
s_x = 1,
s_y = 1,
s_width = 1.4,
package = "FluvialGeomorph\nArcGIS Toolbox ",
p_x = 1,
p_y = 1,
p_hjust = 0,
lineheight = 0.9,
p_color = "#FEFCE2",
p_family = "Just Another Hand",
# p_fontface = "bold",
p_size = 23,
h_size = 3,
h_color = "#3592A8",
white_around_sticker = TRUE,
filename = filename)
fuzz <- 30
p <- image_read(filename)
pp <- p %>%
image_fill(color = "transparent", refcolor = "white", fuzz = fuzz, point = "+1+1") %>%
image_fill(color = "transparent", refcolor = "white", fuzz = fuzz, point = paste0("+", image_info(p)$width-1, "+1")) %>%
image_fill(color = "transparent", refcolor = "white", fuzz = fuzz, point = paste0("+1", "+", image_info(p)$height-1)) %>%
image_fill(color = "transparent", refcolor = "white", fuzz = fuzz, point = paste0("+", image_info(p)$width-1, "+", image_info(p)$height-1))
image_write(image = pp, path = "FG_hexes/fg_fgtb_hex_image.png")
file.show("fg_fgtbhex_image.png")
```