The main purpose of these two functions is to create GIF animations.
im.convert(
files,
output = "animation.gif",
convert = c("magick", "convert", "gm convert"),
cmd.fun = if (.Platform$OS.type == "windows") shell else system,
extra.opts = "",
clean = FALSE
)gm.convert(..., convert = "gm convert")
either a character vector of file names, or a single string
containing wildcards (e.g. Rplot*.png
)
the file name of the output (with proper extensions, e.g.
gif
)
the convert
command; it must be 'magick'
,
'convert'
or 'gm convert'
; and it can be pre-specified as an
option in ani.options('convert')
, e.g. (Windows users)
ani.options(convert = 'c:/program
files/imagemagick/convert.exe')
, or (Mac users) ani.options(convert
= '/opt/local/bin/convert')
; see the Note section for more details
a function to invoke the OS command; by default
system
additional options to be passed to convert
(or
gm convert
)
logical: delete the input files
or not
arguments to be passed to im.convert
The command for the conversion.
If ani.options('autobrowse') == TRUE
, this function will also try to
open the output automatically.
The function im.convert
simply wraps the arguments of the
convert
utility of ImageMagick to make it easier to call
ImageMagick in R;
The function gm.convert
is a wrapper for the command
gm convert
of GraphicsMagick.
Examples at https://yihui.org/animation/example/im-convert/
ImageMagick: http://www.imagemagick.org/script/convert.php
GraphicsMagick: http://www.graphicsmagick.org
Other utilities:
saveGIF()
,
saveHTML()
,
saveLatex()
,
saveSWF()
,
saveVideo()