shrink

0th

Percentile

Shrink file size of a PNG

This does not change size of the image in pixels, nor does it affect appearance -- it is lossless compression. This requires the program optipng to be installed.

Usage
shrink(filename)
Arguments
filename

Character vector containing the path of images to resize. Must be PNG files.

Details

If other operations like resizing are performed, shrinking should occur as the last step. Otherwise, if the resizing happens after file shrinking, it will be as if the shrinking didn't happen at all.

• shrink
Examples
if (interactive()) {
webshot("https://www.r-project.org/", "r-shrink.png") %>%
shrink()
}

Documentation reproduced from package webshot, version 0.4.1, License: GPL-2

Community examples

Looks like there are no examples yet.