Learn R Programming

imager (version 0.45.8)

flatten.alpha: Flatten alpha channel

Description

Flatten alpha channel

Usage

flatten.alpha(im, bg = "white")

Value

a blended image

Arguments

im

an image (with 4 RGBA colour channels)

bg

background: either an RGB image, or a vector of colour values, or a string (e.g. "blue"). Default: white background.

Author

Simon Barthelme

See Also

rm.alpha

Examples

Run this code
cimg.limit.openmp()
#Add alpha channel
alpha <- Xc(grayscale(boats))/width(boats)
boats.a <- imlist(boats,alpha) %>% imappend("c")
flatten.alpha(boats.a) %>% plot
flatten.alpha(boats.a,"darkgreen") %>% plot

Run the code above in your browser using DataLab