The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

resmush is an R package for optimizing and compressing images with reSmush.it. reSmush.it is a free API for image optimization and is available through WordPress and many other tools.
reSmush.it includes:
png, jpg/jpeg,
gif, bmp and tiff files.Install resmush from CRAN with:
install.packages("resmush")Check the documentation for the development version at https://dieghernan.github.io/resmush/dev/.
You can install the development version of resmush from GitHub with:
# install.packages("pak")
pak::pak("dieghernan/resmush")Alternatively, install resmush from r-universe:
# Install resmush in R:
install.packages(
"resmush",
repos = c(
"https://dieghernan.r-universe.dev",
"https://cloud.r-project.org"
)
)Compress an online jpg image with
resmush_url():
library(resmush)
url <- "https://dieghernan.github.io/resmush/img/jpg_example_original.jpg"
resmush_url(
url,
outfile = "man/figures/jpg_example_compress.jpg",
overwrite = TRUE
)
#> ══ resmush summary ═════════════════════════════════════════════════════════════
#> ℹ Input: 1 URL, total size 178.7 Kb.
#> ✔ Optimized 1 URL: Size is now 45 Kb (was 178.7 Kb). Saved 133.7 Kb (74.82%).
#> Saved result in directory 'man/figures'.Use the qlty argument to adjust compression quality for
jpg files. Keep this value above 90 to maintain good image
quality.
# Use an extreme compression setting.
resmush_url(
url,
outfile = "man/figures/jpg_example_compress_low.jpg",
overwrite = TRUE,
qlty = 3
)
#> ══ resmush summary ═════════════════════════════════════════════════════════════
#> ℹ Input: 1 URL, total size 178.7 Kb.
#> ✔ Optimized 1 URL: Size is now 2.2 Kb (was 178.7 Kb). Saved 176.4 Kb (98.74%).
#> Saved result in directory 'man/figures'.All optimization functions invisibly return a data frame that summarizes the process. The following example shows this output when compressing a local file:
png_file <- system.file("extimg/example.png", package = "resmush")
# Copy to a temporary file for this example.
tmp_png <- tempfile(fileext = ".png")
file.copy(png_file, tmp_png, overwrite = TRUE)
#> [1] TRUE
summary <- resmush_file(tmp_png, overwrite = TRUE)
tibble::as_tibble(summary[, -c(1, 2)])
#> # A tibble: 1 × 6
#> src_size dest_size compress_ratio notes src_bytes dest_bytes
#> <chr> <chr> <chr> <chr> <dbl> <dbl>
#> 1 239.9 Kb 70.7 Kb 70.54% OK 245618 72356Several other R packages also provide image optimization tools:
xfun::tinify(): Similar to resmush_file()
but uses TinyPNG and
requires an API key.xfun::optipng(): Compresses local files using
OptiPNG, which must be installed locally.png and jpg/jpeg
files using Rust libraries.xfun::optipng() but with more options. Requires
additional local software.| Tool | CRAN | Additional software | Online images | API key required | Limits |
|---|---|---|---|---|---|
xfun::tinify() |
Yes | No | Yes | Yes | 500 files/month (free tier) |
xfun::optipng() |
Yes | Yes | No | No | No |
| tinieR | No | No | Yes | Yes | 500 files/month (free tier) |
| tinyimg | Yes | Yes | No | No | No |
| optout | No | Yes | No | No | No |
| resmush | Yes | No | Yes | No | Maximum size: 5 MB |
Table 1: R packages: comparison of image optimization alternatives.
| Tool | png | jpg | gif | bmp | tiff | webp | |
|---|---|---|---|---|---|---|---|
xfun::tinify() |
✅ | ✅ | ❌ | ❌ | ❌ | ✅ | ❌ |
xfun::optipng() |
✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| tinieR | ✅ | ✅ | ❌ | ❌ | ❌ | ✅ | ❌ |
| tinyimg | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| optout | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ |
| resmush | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
Table 2: R packages: supported formats.
Hernangómez D (2026). resmush: Optimize and Compress Image Files with reSmush.it. doi:10.32614/CRAN.package.resmush. https://dieghernan.github.io/resmush/.
A BibTeX entry for LaTeX users:
@Manual{R-resmush,
title = {{resmush}: Optimize and Compress Image Files with {reSmush.it}},
doi = {10.32614/CRAN.package.resmush},
author = {Diego Hernangómez},
year = {2026},
version = {1.0.1},
url = {https://dieghernan.github.io/resmush/},
abstract = {Optimize and compress local image files, directories and online images with the reSmush.it API <https://resmush.it/>. Supports png, jpg/jpeg, gif, bmp and tiff files.},
}
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.