animate: Create an animated gif from a list of stimuli

View source: R/animate.R

animateR Documentation

Create an animated gif from a list of stimuli

Description

Create an animated gif from a list of stimuli

Usage

animate(stimuli, fps = 1, loop = 0, rev = FALSE)

Arguments

stimuli

list of stimuli

fps

frames per second

loop

how many times to loop the animation (0 = infinite)

rev

whether to loop back and forth (TRUE) or in one direction (FALSE)

Value

magick image

See Also

Stimulus creating functions as_stimlist(), blank(), new_stimlist(), new_stim(), read_img(), read_stim(), read_tem(), write_stim()

Examples


# slideshow of images (1/second)
demo_stim() |> animate()

# rotate a face
degrees <- seq(0, 350, 10)
demo_stim(1) |>
  mask() |>
  rep(length(degrees)) |>
  rotate(degrees) |>
  animate(fps = 10)


debruine/webmorphR documentation built on Aug. 15, 2022, 3:51 p.m.