Description Usage Arguments Examples
Automatically crop away white space form an image. Can read any image
supported by raster
.
1 2 |
x |
a file or a raster object |
border |
border of whitespace, in pixels, to leave around image. |
outfile |
output file to save. Defaults to NULL |
format |
file format type. Guessed by outfile extension. |
width |
width is specified (defaults to current device width). Height is determined by aspect ratio of cropped image. |
units |
units defualts to inches, but may be any units supported by the output format. |
res |
output dpi. Defaults to 150. |
... |
parameters to pass to specfified output device (e.g. tiff()). |
1 2 3 4 5 6 7 8 | x<-rep(0,49)
x[18]<-1
x[24:25]<-1
x[31:32]<-1
x<-raster::stack(raster::raster(matrix(x,ncol=7,byrow = TRUE)))
raster::extent(x) <- raster::extent(c(1,7,1,7))
x_ac<-autocrop(x,border=0)
x_ac<-autocrop(system.file("extdata/big_test.tiff",package="autocrop"), outfile = "test_devs.tiff", width = 6.1, res = 450, compression = "lzw")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.