imagecrop: Interface to the 'imagemagic convert' tool for cropping...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/imagecrop.R

Description

Automatically cropping of PNG, JPG, etc image files using the convert comand line tool (http://www.imagemagick.org/) .

Usage

1
imagecrop(fileName, outFileName = NULL)

Arguments

fileName

character string denoting the path/ name of the input file

outFileName

character string denoting the name of the output file. If not specified, "_cr.[original file format]" is appended to fileName.

Value

Returns nothing, but as a side effect saves the cropped image file.

Author(s)

Christoph Schmidt <[email protected]>

See Also

knitr plot_crop, ImageMagick http://www.imagemagick.org/

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
library(networkD3)
data(MisLinks)
data(MisNodes)
p <- forceNetwork(Links = MisLinks, Nodes = MisNodes,
             Source = "source", Target = "target",
             Value = "value", NodeID = "name",
             Group = "group", opacity = 0.9,
             height = 900, width = 900)

# generated PNG needs a serious cropping
jsGraphic2Png(p, c(900, 900, 20, 20), slow = TRUE)
imagecrop("JSgraphic.png", "JSgraphicCr1.png")

# generated PNG needs a serious cropping
jsGraphic2Png(p, c(900, 900, 20, 20), slow = FALSE)
imagecrop("JSgraphic.png")

file.remove(c("JSgraphic.png", "JSgraphicCr1.png", "JSgraphic_cr.png"))

schmidtchristoph/js2graphic documentation built on July 8, 2018, 4:10 p.m.