trim: Trim edges from images

View source: R/trim.R

trimR Documentation

Trim edges from images

Description

Removes border pixels from selected frames by detecting the background colour and trimming uniform edges. Wraps magick::image_trim.

Usage

trim(images, fuzz = 0, frames = NULL)

Arguments

images

an object of class magick-image to modify

fuzz

a number in [0, 100] controlling colour tolerance when detecting the background. Higher values trim more aggressively.

frames

integer vector of frame indices to duplicate. Defaults to NULL, which duplicates all frames.

Value

a magick-image object

Verbosity

After each operation a message listing the updated frame sequence is printed in interactive sessions. Use stopmotion_verbosity(FALSE) to suppress these messages, or set options(stopmotion.verbose = FALSE) in your script or ‘.Rprofile’.

Examples


  dino_dir <- system.file("extdata", package = "stopmotion")
  images <- read(dir = dino_dir)
  trim(images = images)
  trim(images = images, fuzz = 10, frames = 1:3)


stopmotion documentation built on March 24, 2026, 5:06 p.m.

Related to trim in stopmotion...