Skip to contents

Crop images of class *Image in this package with a bounding box.

Usage

# S4 method for class 'SpatRasterImage'
cropImg(x, bbox, filename = "")

# S4 method for class 'BioFormatsImage'
cropImg(x, bbox)

# S4 method for class 'ExtImage'
cropImg(x, bbox)

Arguments

x

An object of class *Image as implemented in this package.

bbox

Numeric vector with names "xmin", "xmax", "ymin", "ymax", in any order, to specify the bounding box.

filename

Output file name for transformed SpatRaster.

Value

Image of the same class as input but cropped. For BioFormatsImage, the image is not loaded into memory; only the extent is changed.