image_crop: Crop an image to a rectangular region

View source: R/image_export.R

image_cropR Documentation

Crop an image to a rectangular region

Description

Crop an image to a rectangular region

Usage

image_crop(image, x, y, w, h)

Arguments

image

An image list returned by render_mesh() or similar.

x

Left edge of the crop region (0-based pixel coordinate).

y

Top edge of the crop region (0-based pixel coordinate).

w

Crop width in pixels.

h

Crop height in pixels.

Value

A new image list with the cropped dimensions.

Examples

cube <- generate_cuboid(c(0, 0, 0), c(1, 1, 1))
img <- render_mesh(cube$vertices, cube$triangles)
img <- image_crop(img, 100, 50, 400, 300)


scimesh documentation built on Aug. 9, 2026, 9:07 a.m.