hex_crop {cropcircles} | R Documentation |
Reads in an image and crops to a hexagon. If a new path is given it will save the cropped images to the new location. If no path is given it will save to a temporary location which will be cleared when the session is closed
hex_crop(images, to = NULL)
images |
Vector of image paths, either local or urls. If urls the images will be downloaded first. |
to |
Path to new location |
Path to cropped images
library(magick)
x <- c(1, 3, 9, 8)
path <- "https://openpsychometrics.org/tests/characters/test-resources/pics/BB/"
img_paths <- paste0(path, x, ".jpg")
img_paths_cropped <- hex_crop(img_paths)
imgs <- image_read(img_paths_cropped)
image_montage(imgs)