render_clamp: Clamp Image

View source: R/render_clamp.R

render_clampR Documentation

Clamp Image

Description

Clamps an image to a user-specified range, ignoring the alpha channel.

Usage

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

Arguments

image

3-layer RGB/4-layer RGBA array, rayimg class, or filename of an image.

min_value

Default 0. Minimum value to clamp the RGB channels in the image to.

max_value

Default 1. Maximum value to clamp the RGB channels in the image to.

filename

Default NA. Filename

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

A rayimg RGBA array.

Examples


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


rayimage documentation built on June 12, 2026, 5:06 p.m.