View source: R/ray_read_image.R
| ray_read_image | R Documentation |
Reads an image from a file/array/matrix. From files, supports
JPEG, PNG, TIFF, TGA, BMP, PSD, GIF, HDR, PIC, PNM, EXR,
and DNG images.
ray_read_image(
image,
convert_to_array = FALSE,
preview = FALSE,
source_linear = NA,
normalize = FALSE,
dng_normalize = FALSE,
normalize_to = CS_ACESCG,
normalize_adapt_white = TRUE,
assume_colorspace = NULL,
assume_white = NULL,
reset_camera_settings = FALSE,
...
)
image |
3-layer RGB/4-layer RGBA array, |
convert_to_array |
Default |
preview |
Default |
source_linear |
Default |
normalize |
Default |
dng_normalize |
Default |
normalize_to |
Default |
normalize_adapt_white |
Default |
assume_colorspace |
Default |
assume_white |
Default |
reset_camera_settings |
Default |
... |
Arguments to pass to |
A rayimg RGBA array.
#Write as a png
tmparr = tempfile(fileext=".png")
ray_read_image(dragon) |>
ray_write_image(tmparr)
ray_read_image(tmparr) |>
plot_image()
#Write as a JPEG (passing quality arguments via ...)
tmparr = tempfile(fileext=".jpg")
ray_read_image(dragon) |>
ray_write_image(tmparr, quality = 0.2)
ray_read_image(tmparr) |>
plot_image()
#Write as a tiff
tmparr = tempfile(fileext=".tiff")
ray_read_image(dragon) |>
ray_write_image(tmparr)
ray_read_image(tmparr) |>
plot_image()
#Write as an exr
tmparr = tempfile(fileext=".exr")
ray_read_image(dragon) |>
ray_write_image(tmparr)
ray_read_image(tmparr) |>
plot_image()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.