square_crop {cropcircles}R Documentation

Square crop

Description

Reads in an image and square crops. 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

Usage

square_crop(images, to = NULL)

Arguments

images

Vector of image paths, either local or urls. If urls the images will be downloaded first.

to

Path to new location

Value

Path to cropped images

Examples

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 <- square_crop(img_paths)

imgs <- image_read(img_paths_cropped)
image_montage(imgs)

[Package cropcircles version 0.1.1 Index]