Learn R Programming

animation (version 2.2)

im.convert: A wrapper for the `convert' utility of ImageMagick or GraphicsMagick

Description

The main purpose of these two functions is to create GIF animations.

Usage

im.convert(files, output = "animation.gif", convert = c("convert", "gm convert"), 
    cmd.fun = system, extra.opts = "", clean = FALSE)

gm.convert(..., convert = "gm convert")

Arguments

files
either a character vector of file names, or a single string containing wildcards (e.g. Rplot*.png)
output
the file name of the output (with proper extensions, e.g. gif)
convert
the convert command; it must be either 'convert' or 'gm convert'; and it can be pre-specified as an option in ani.options('convert'), e.g. (Windows u
cmd.fun
a function to invoke the OS command; by default system
extra.opts
additional options to be passed to convert (or gm convert)
clean
logical: delete the input files or not
...
arguments to be passed to im.convert

Value

  • The command for the conversion.

    If ani.options('autobrowse') == TRUE, this function will also try to open the output automatically.

Details

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.