Learn R Programming

stopmotion (version 0.1.0)

border: Add a border to images

Description

Adds a coloured border around selected frames. Wraps magick::image_border.

Usage

border(images, color = "lightgray", geometry = "10x10", frames = NULL)

Value

a magick-image object

Arguments

images

an object of class magick-image to modify

color

a character string specifying the border colour, e.g. "black" or "#FF0000".

geometry

a geometry string specifying border width and height, e.g. "10x10" for a 10-pixel border on all sides.

frames

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

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

Run this code
# \donttest{
  dino_dir <- system.file("extdata", package = "stopmotion")
  images <- read(dir = dino_dir)
  border(images = images, color = "black", geometry = "5x5")
  border(images = images, color = "white", geometry = "10x10", frames = 1:3)
# }

Run the code above in your browser using DataLab