Description Usage Arguments Value Note Examples
View source: R/rs_colorspace.R
Imagemagick is used for the calculation of the transformations. Please provide a tif file
1 2 3 4 5 6 7 8 | colorspace(
input = NULL,
colorspace = c("CIELab", "CMY", "Gray", "HCL", "HSB", "HSI", "Log", "XYZ", "YUV"),
compress = "None",
depth = 8,
verbose = FALSE,
retRaster = TRUE
)
|
input |
character. name of a (Geo)Tiff containing RGB data channels |
colorspace |
character. For a list of argument to determine colorspace see colorspace manual |
compress |
character. compression type depending on the imagemagick version the choices are: None, BZip, Fax, Group4, JPEG, JPEG2000, Lossless, LZW, RLE or Zip. |
depth |
numeric. color space depth in bit default is 8 |
verbose |
be quiet |
retRaster |
logical if true a rasterstack is returned |
raster* object
you need to install imagemagick on your system, please look at see imagemagick download section.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## Not run:
##- required packages
require(uavRst)
setwd(tempdir())
data("rgb")
raster::plotRGB(rgb)
fn<-file.path(tempdir(),"rgb.tif")
raster::writeRaster(rgb,
filename=fn,
format="GTiff",
overwrite=TRUE)
##- original color space
raster::plotRGB(raster::stack("rgb.tif"))
##- change colorspace from RGB to HSI
r2 <- colorspace(input="rgb.tif",colorspace="HSI")
##- visualize it
raster::plotRGB(r2)
##+
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.