Resize and crop/pad images to a specified size
Usage
to_size(
stimuli,
width = NULL,
height = NULL,
fill = wm_opts("fill"),
crop = FALSE,
keep_rels = FALSE
)
Arguments
- stimuli
list of stimuli
- width
the target width (if null, the maximum stimulus width is used)
- height
the target height (if null, the maximum stimulus height is used)
- fill
background color if cropping goes outside the original image, see
color_conv()
- crop
whether to crop or pad images to make them the specified size
- keep_rels
whether to keep the size relationships between images in the set, or make all the maximum size
Examples
# images with different aspect ratios and sizes
stimuli <- demo_unstandard(c(1:4, 6:9))
to_size(stimuli, 200, 200, fill = "dodgerblue")