0
library(cowplot)
ggdraw() +
    draw_plot(p) +
  draw_image(magick::image_read("img.png"),
             scale = .25, x = .4, y = .1)

Here p is not even important, I would just like to add a black border to img.png.

Axeman
  • 32,068
  • 8
  • 81
  • 94
GiulioGCantone
  • 195
  • 1
  • 10

1 Answers1

0
library(cowplot)
library(magick)

tiger <- image_read_svg('http://jeroen.github.io/images/tiger.svg', width = 350)

ggdraw() +
  draw_image(
    tiger,
    scale = .5, x = -0.25, y = 0.25
  ) +
  draw_image(
    tiger |> magick::image_border(color = 'black'),
    scale = .5, x = 0.25, y = 0.25
  ) +
  draw_image(
    tiger |> magick::image_border(color = 'firebrick'),
    scale = .5, x = -0.25, y = -0.25
  ) +
  draw_image(
    tiger |> magick::image_border(color = 'navy'),
    scale = .5, x = 0.25, y = -0.25
  )

enter image description here

Axeman
  • 32,068
  • 8
  • 81
  • 94