Learn R Programming

rayimage (version 0.2.3)

add_vignette: Add Vignette Effect

Description

Takes an RGB array/filename and adds a camera vignette effect.

Usage

add_vignette(image, vignette = 0.5, filename = NULL, preview = FALSE)

Arguments

image

Image filename or 3-layer RGB array.

vignette

Default 0.5. 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).

filename

Default NULL. Filename which to save the image. If NULL and preview = FALSE, returns an RGB array.

preview

Default FALSE. If TRUE, it will display the image in addition to returning it.

Value

3-layer RGB array of the processed image.

Examples

Run this code
# NOT RUN {
#Plot the dragon
plot_image(dragon)

#Add a vignette effect:
# }
# NOT RUN {
add_vignette(dragon, preview = TRUE, vignette = 0.5)
# }
# NOT RUN {
#Darken the vignette effect:
# }
# NOT RUN {
add_vignette(dragon, preview = TRUE, vignette = 1)
# }
# NOT RUN {
#Increase the width of the blur by 50%:
# }
# NOT RUN {
add_vignette(dragon, preview = TRUE, vignette = c(1,1.5))
# }

Run the code above in your browser using DataLab