trimImages {Orcs} | R Documentation |
Remove Whitespace from Images
Description
This is a wrapper function around convert -trim
to automatically remove any
whitespace from locally saved images. Note that 'ImageMagick' must be
installed on your local system, see Source.
Usage
trimImages(path = ".", pattern = c(".png$", ".tiff$"))
Arguments
path |
File path leading to image files as |
pattern |
A regular expression as |
Value
A character
vector containing the names of the processed images.
Author(s)
Florian Detsch
Source
Ooms J (2018) The magick package: Advanced Image-Processing in R. Available online: https://cran.r-project.org/package=magick/vignettes/intro.html.
See Also
Examples
## Not run:
## trim image of bart simpson
download.file("http://pngimg.com/uploads/simpsons/simpsons_PNG93.png?i=1"
, destfile = (ofl <- file.path(tempdir(), "bart.png", fsep = "\\"))
, mode = "wb")
par(mfrow = c(1, 2))
img = brick(ofl)
plotRGB(img)
jnk = trimImages(tempdir(), "bart.png")
trm = brick(jnk)
plotRGB(trm)
dev.off()
## End(Not run)
[Package Orcs version 1.2.3 Index]