render_clamp: Clamp Image

View source: R/render_clamp.R

render_clampR Documentation

Clamp Image

Description

Clamps an image to a user-specified range

Usage

render_clamp(image, min_value = 0, max_value = 1, preview = FALSE, ...)

Arguments

image

Image filename or 3-layer RGB array.

min_value

Default 0. Minimum value to clamp the image to.

max_value

Default 1. Maximum value to clamp the image to.

preview

Default FALSE. If TRUE, it will display the image in addition to returning it.

...

Arguments to pass to either jpeg::readJPEG, png::readPNG, or tiff::readTIFF.

Value

3-layer RGB array of the processed image.

Examples

if(run_documentation()){
#The rnage of the unchanged image
range(dragon)
}
if(run_documentation()){
#Clamp the maximum and minimum values to one and zero
render_clamp(dragon) |>
 range()
}

rayimage documentation built on Sept. 11, 2024, 8:13 p.m.