Takes an RGB array/filename and adds a camera vignette effect.
render_vignette(
image,
vignette = 0.5,
color = "#000000",
radius = 1.1,
filename = NULL,
preview = FALSE
)3-layer RGB/4-layer RGBA array, rayimg class, or filename of an image.
Default 1. A camera vignetting effect will be added to the image.
1 is the darkest vignetting, while 0 is no vignetting. If vignette is a length-2 vector, the second entry will
control the blurriness of the vignette effect (1 is the default, e.g. 2 would double the blurriness but would take
much longer to compute).
Default "#000000" (black). Color of the vignette.
Default 1.1. Multiplier for the size of the vignette. If 1, the vignette touches
the edge of the image.
Default NULL. Filename which to save the image. If NULL and preview = FALSE,
returns an RGB array.
Default FALSE. If TRUE, it will display the image in addition
to returning it.
A rayimg RGBA array.
if(run_documentation()){
#Plot the dragon
plot_image(dragon)
}
if(run_documentation()){
#Add a vignette effect:
render_vignette(dragon, preview = TRUE, vignette = 1, radius=1.1)
}
if(run_documentation()){
#Lighten the vignette effect:
render_vignette(dragon, preview = TRUE, vignette = 0.5)
}
if(run_documentation()){
#Change the radius:
render_vignette(dragon, preview = TRUE, vignette = 1, radius=1.5)
render_vignette(dragon, preview = TRUE, vignette = 0.1, radius=0.8)
}
if(run_documentation()){
#Change the color:
render_vignette(dragon, preview = TRUE, vignette = 1, color="white")
}
if(run_documentation()){
#Increase the width of the blur by 50%:
render_vignette(dragon, preview = TRUE, vignette = c(1,1.5))
}