img_read | R Documentation |
Read a greyscale image
img_read(file, invert = FALSE)
file |
path to the input image file. |
invert |
when TRUE, invert the input image (useful for further processing functions such as |
A imager::cimg()
object, which is a four-dimensional numeric array having x,y,z,c coordinates, where x,y are image pixel dimensions, z is depth (for a sequence of images), and c is colour channels (1 for greyscale images, 3 for RGB images, 4 for RGBA images).
path <- system.file("extdata", "blob.jpg", package="morphr")
img_read(path) %>% img_show()
img_read(path, invert=TRUE) %>% img_show()
# or shorter
img_read(path, i=TRUE) %>% img_show()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.