if (FALSE) {
## 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()
}
Run the code above in your browser using DataLab