shrink | R Documentation |
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.
shrink(filename)
filename |
Character vector containing the path of images to resize. Must be PNG files. |
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.
The 'filename' supplied but with a class value of '"webshot"'.
if (interactive()) {
webshot("https://www.r-project.org/", "r-shrink.png") %>%
shrink()
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.