Chromatic-adapt an image from reference_white to target_white in its working RGB space.
When bake = FALSE (the default), this should not result in any visible changes to the image when
plotted in rayimage via plot_image(), as that function then corrects the white balance for
display. Set
render_white_balance(
image,
reference_white = NA,
target_white = "D60",
bake = FALSE,
filename = NULL,
preview = FALSE
)Default NULL. 3-layer RGB/4-layer RGBA array, rayimg, or filename.
Default NA. Source white (XYZ Y=1 or named); when NA, uses attr(img, "white_current").
Default "D60". Target white (XYZ Y=1 or named).
Default FALSE. If TRUE, this will bake the color change into the image, and return the
old tag. This can be used for stylistic adjustments.
Default NULL. Output path.
Default FALSE. If TRUE, display the image.
# Not specifying a target white balance returns an unchanged image
render_white_balance(dragon, preview = TRUE)
# Default white "D60", converting to D50 produces a warmer image
render_white_balance(dragon, preview = TRUE, target_white = "D50", bake = TRUE)
# Default white "D60", converting to "D75" produces a cooler image
render_white_balance(dragon, preview = TRUE, target_white = "D75", bake = TRUE)
# Set reference white to colder "D75", converting to "D50" produces a very warm image
render_white_balance(dragon, preview = TRUE,
reference_white= "D75", target_white = "D50", bake = TRUE)
# With a real, non-rendered image:
render_white_balance(sunset_image, preview=TRUE)
# Cooler
render_white_balance(sunset_image, preview=TRUE, target_white = "D75", bake = TRUE)
# Warmer
render_white_balance(sunset_image, preview=TRUE, target_white = "D50", bake = TRUE)