write_tif | R Documentation |
Write images into a TIFF file.
write_tif(
img,
path,
bits_per_sample = "auto",
compression = "none",
overwrite = FALSE,
msg = TRUE
)
tif_write(
img,
path,
bits_per_sample = "auto",
compression = "none",
overwrite = FALSE,
msg = TRUE
)
img |
An array representing the image.
|
path |
file name or a raw vector |
bits_per_sample |
number of bits per sample (numeric scalar). Supported
values are 8, 16, and 32. The default |
compression |
A string, the desired compression algorithm. Must be one
of |
overwrite |
If writing the image would overwrite a file, do you want to proceed? |
msg |
Print an informative message about the image being written? |
The input img
(invisibly).
Simon Urbanek wrote most of this code for the 'tiff' package. Rory Nolan lifted it from there and changed it around a bit for this 'ijtiff' package. Credit should be directed towards Lord Urbanek.
read_tif()
img <- read_tif(system.file("img", "Rlogo.tif", package = "ijtiff"))
temp_dir <- tempdir()
write_tif(img, paste0(temp_dir, "/", "Rlogo"))
img <- matrix(1:4, nrow = 2)
write_tif(img, paste0(temp_dir, "/", "tiny2x2"))
list.files(temp_dir, pattern = "tif$")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.