img_show: Display an array of pixel as a greyscale image

View source: R/img_show.R

img_showR Documentation

Display an array of pixel as a greyscale image

Description

Display an array of pixel as a greyscale image

Usage

img_show(x)

Arguments

x

a greyscale image, with grey levels coded in ⁠[0, 1]⁠. This can be either a 2D matrix of pixels or a 4D imager::cimg() object.

Value

The input image, invisibly (this allows to use img_show() within a pipe chain).

Examples

# check that the overall grey level is reflected in the plot
img_show(matrix(runif(100, 0, 0.5), nrow=10))
img_show(matrix(runif(100, 0.5, 1), nrow=10))

# display an image
path <- system.file("extdata", "blob.jpg", package="morphr")
x <- img_read(path)
img_show(x)

jiho/morphr documentation built on May 11, 2024, 9:32 p.m.