Skip to contents

Write images and templates to files

Usage

write_stim(
  stimuli,
  dir = ".",
  names = NULL,
  format = "png",
  ...,
  overwrite = wm_opts("overwrite")
)

Arguments

stimuli

list of stimuli

dir

Directory to save to

names

A vector of stimulus names or NULL to use names from the stimuli list

format

output format such as "png", "jpeg", "gif"; is overridden if names end in .png, .jpg, or .gif

...

other arguments to pass to magick::image_write, such as quality (for jpegs)

overwrite

whether to overwrite existing files (TRUE/FALSE) or "ask" (only in interactive mode)

Value

list of saved paths

See also

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

Examples

if (FALSE) {
# write demo stim as jpegs to directory ./test_faces
demo_stim() |> 
  write_stim("test_faces", format = "jpg")
}