Magick: Combining several images into one while controlling their relative position

Thank you for your quick response, @jeroenooms . It is indeed what I was looking for!

I could do what I was looking for with this code (adapted from yours):

library(magick)

bowser <- image_read('https://upload.wikimedia.org/wikipedia/en/9/92/Bowser_Stock_Art_2021.png') %>% image_scale('200x')
yoshi <- image_read('https://upload.wikimedia.org/wikipedia/en/d/db/Yoshi_%28Nintendo_character%29.png') %>% image_scale('200x')
peach <- image_read('https://upload.wikimedia.org/wikipedia/en/1/16/Princess_Peach_Stock_Art.png') %>% image_scale('200x')
toad <- image_read('https://upload.wikimedia.org/wikipedia/en/d/d1/Toad_3D_Land.png') %>% image_scale('200x')

image_blank(1000, 1000, color = 'white') %>%
  image_composite(bowser, gravity = 'north')  %>%
  image_composite(yoshi,  gravity = 'east')  %>%
  image_composite(peach, gravity = 'south')  %>%
  image_composite(toad, gravity = 'west')

Now I’ll be investigating how to save that image into a file.

Thanks fro your help!

EDIT: here it is! The magick package: Advanced Image-Processing in R • rOpenSci: magick

1 Like