read: Read images into a stop-motion film

View source: R/read.R

readR Documentation

Read images into a stop-motion film

Description

Reads all image files from dir (optionally filtered by pattern) and returns them as a magick-image object.

Usage

read(dir, pattern = "")

Arguments

dir

path to directory containing the images relative to working directory.

pattern

an optional regular expression. Only file names which match the regular expression will be returned.

Value

an object of class magick-image

Frame order

Frames are loaded in the order returned by list.files, which sorts filenames lexicographically. This means the filesystem filename order determines the stop-motion frame order. Name your files accordingly (e.g. frame_001.png, frame_002.png, ...) to guarantee the intended sequence. If you need to reorder frames after loading, use arrange.

Examples

 
   dino_dir <- system.file("extdata", package = "stopmotion")
   images <- read(dir = dino_dir)


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

Related to read in stopmotion...