# resmush
[](https://CRAN.R-project.org/package=resmush)
[](https://cran.r-project.org/web/checks/check_results_resmush.html)
[](https://CRAN.R-project.org/package=resmush)
[](https://github.com/dieghernan/resmush/actions/workflows/check-full.yaml)
[](https://github.com/dieghernan/resmush/actions/workflows/rhub.yaml)
[](https://app.codecov.io/gh/dieghernan/resmush)
[](https://www.codefactor.io/repository/github/dieghernan/resmush)
[](https://dieghernan.r-universe.dev/resmush)
[](https://doi.org/10.32614/CRAN.package.resmush)
[](https://www.repostatus.org/#active)
[](https://CRAN.R-project.org/package=resmush)
**resmush** is a **R** package that allows users to optimize and
compress images using [**reSmush.it**](https://resmush.it/). reSmush.it
is a free API that provides image optimization and has been
implemented in
[WordPress](https://wordpress.org/plugins/resmushit-image-optimizer/)
and [many other tools](https://resmush.it/tools/).
Some of the features of **reSmush.it** include:
- Free optimization services with no API key required.
- Support for both local and online images.
- Supported image formats: `png`, `jpg/jpeg`, `gif`, `bmp`, `tiff`.
- Maximum image size: 5 MB.
- Compression using several algorithms:
- [**PNGQuant**](https://pngquant.org/): Removes unnecessary chunks
from `png` files while preserving a full alpha transparency.
- [**JPEGOptim**](https://github.com/tjko/jpegoptim)**:** Lossless
optimization based on Huffman table optimization.
- [**OptiPNG**](https://optipng.sourceforge.net/): A `png` optimizer
used by several online compression tools.
## Installation
](https://raw.githubusercontent.com/dieghernan/resmush/main/img/jpg_example_original.jpg)
[
](https://dieghernan.github.io/resmush/reference/figures/jpg_example_compress.jpg)
Original picture (top): 178.7 Kb; Optimized picture (bottom): 45 Kb (Compression: 74.8%). Click to enlarge.
](https://dieghernan.github.io/resmush/reference/figures/jpg_example_compress_low.jpg)
Low quality image due to a high compression rate.
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 is @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 = {0.2.2.9000}, url = {https://dieghernan.github.io/resmush/}, abstract = {Compress local and online images using the reSmush.it API service