Learn R Programming

xfun (version 0.30)

optipng: Run OptiPNG on all PNG files under a directory

Description

Call the command optipng via system2() to optimize all PNG files under a directory.

Usage

optipng(
  dir = ".",
  files = list.files(dir, "[.]png$", recursive = TRUE, full.names = TRUE),
  ...
)

Arguments

dir

Path to a directory.

files

Alternatively, you can choose the specific files to optimize.

...

Arguments to be passed to system2().

References

OptiPNG: http://optipng.sourceforge.net.