BotanizeR_imageresize.Rd
Batch resize images for plotting in BotanizeR_quiz()
or
BotanizeR Shiny app maintaining aspect ratio.
BotanizeR_imageresize( image_folders = NULL, image_width = NA, max_height = NA, int_type = 1, quality = 1 )
image_folders | character vector defining folders where images that shall be resized are stored. |
---|---|
image_width | number defining the width of the resized images as number of pixels. |
max_height | number defining the maximum height of the resized images.
If |
int_type | number indicating the method of interpolation used in
|
quality | numeric > 0 and <= 1 defining the quality of the images when
saved as *.jpg by |
Resized images will be saved at the same location where the input folders
are located but folder names will be expanded about
paste("_",image_width,sep="")
.
Resizing images to make them fit and load faster in the
BotanizeR Shiny application and BotanizeR_quiz()
.
Weigelt, P., Denelle, P., Brambach, F. & Kreft, H. (2021) A flexible R package with Shiny app to practice plant identification for online teaching and beyond. PLANTS, PEOPLE, PLANET, https://doi.org/10.1002/ppp3.10226.
# Example if (FALSE) { BotanizeR_imageresize(image_folders = "inst/WWW/images_to_resize", image_width = 560, max_height = 700, quality = 1) BotanizeR_imageresize(image_folders = c("inst/WWW/images_to_resize_1", "inst/WWW/images_to_resize_2"), image_width = 560, max_height = 700, quality = 1, int_type = 5) }