Skip to contents

Crop an image using bounding box values. This function acts as a wrapper for magick::image_crop(), with the ability to convert between bounding box types.

Usage

img_crop_bbox(image, bbox, format = "xywh", file = NULL, overwrite = FALSE)

Arguments

image

character or magick-image. The image to crop.

bbox

character vector. Bounding box values.

format

character. Format of the input bounding box. Options: "xyxy", "xywh", "centerwh". See bbox_convert().

file

character or NULL. File path to the output image.

overwrite

logical. If overwriting files is allowed.

Value

a magick image.