% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/render_vibrance.R
\name{render_vibrance}
\alias{render_vibrance}
\title{Render Vibrance}
\usage{
render_vibrance(
  image,
  vibrance = 0,
  protect_luminance = 0.25,
  filename = NULL,
  preview = FALSE
)
}
\arguments{
\item{image}{Image filename, 3-layer RGB array, 4-layer RGBA array, or matrix. If a filename,
it will be read via \code{ray_read_image()}.}

\item{vibrance}{Default \code{0}. Numeric scalar in -1..1 (values are clamped). Positive values
increase vibrance primarily in low-saturation regions; negative values decrease vibrance primarily
in high-saturation regions.}

\item{protect_luminance}{Default \code{0.25}. Numeric scalar in 0..1. Reduces the vibrance effect
in deep shadows and bright highlights to avoid harsh color shifts. Set to \code{0} to disable.}

\item{filename}{Default \code{NULL}. If not \code{NULL}, the processed image will be written to this file.}

\item{preview}{Default \code{FALSE}. Whether to plot the processed image.}
}
\value{
4-layer RGBA array (or matrix if passed a matrix and \code{ray_read_image()} is not used).
}
\description{
Adjusts image vibrance (adaptive saturation), similar in spirit to the iPhone "Vibrance" control:
it boosts muted colors more than already-saturated colors, and reduces saturation more strongly
in already-saturated regions when negative. Works on HDR arrays as well (values can exceed 1).
}
\examples{
\dontshow{if (interactive() || identical(Sys.getenv("IN_PKGDOWN"), "true")) withAutoprint(\{ # examplesIf}
  dragon |>
    render_vibrance(vibrance = 0.4, preview = TRUE)
\dontshow{\}) # examplesIf}
}
