Clamps an image to a user-specified range
render_clamp(
image,
filename = NA,
min_value = 0,
max_value = 1,
preview = FALSE,
...
)
3-layer RGB/4-layer RGBA array, rayimg
class, or filename of an image.
Default NA
. Filename
Default 0
. Minimum value to clamp the image to.
Default 1
. Maximum value to clamp the image to.
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
.
A rayimg
RGBA array.
if(run_documentation()){
#The image of the unchanged image
range(dragon)
}
#> [1] 0 1
if(run_documentation()){
#Clamp the maximum and minimum values to one and zero
render_clamp(dragon) |>
range()
}
#> [1] 0 1