duplicate: Duplicate frames

View source: R/duplicate.R

duplicateR Documentation

Duplicate frames

Description

Duplicate frames

Usage

duplicate(images, style = c("linear", "looped", "shuffle"), frames = NULL)

Arguments

images

an object of class magick-image to modify

style

one of "linear", "looped", or "shuffle", controlling how duplicates are inserted:

"linear"

inserts one copy immediately before each selected frame, in order. The original frame follows its duplicate.

"looped"

appends one copy of each selected frame (in order) after max(frames), creating a loop-back effect. Requires frames to be a consecutive sequence.

"shuffle"

randomly reorders both the originals and their copies within the selected range, replacing those positions. Requires frames to be a consecutive sequence.

frames

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

Value

a magick-image object with duplicate frames inserted.

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)
  duplicate(images = images, style = "shuffle", frames = 1:2)


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