library(knitr) opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of minimage is to let users minify size images.
The main function allows to compress the images contained in a directory to another directory, optionally changing some compression parameters.
You can install minimage from GitHub with:
# install.packages("devtools") devtools::install_github("ardata-fr/minimage")
file.copy(system.file(package = "minimage", "test-files"), to = ".", recursive = TRUE) dir.create("test-new-files", recursive = TRUE)
library(minimage) compress_images("test-files/", "test-new-files/", verbose = FALSE) compress_images("test-files/", "test-new-files/", png_quality = "90-100", verbose = FALSE, overwrite = TRUE)
unlink("test-files", force = TRUE, recursive = TRUE) unlink("test-new-files", force = TRUE, recursive = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.