flatten.alpha: Flatten alpha channel

View source: R/utils.R

flatten.alphaR Documentation

Flatten alpha channel

Description

Flatten alpha channel

Usage

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

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.

Value

a blended image

Author(s)

Simon Barthelme

See Also

rm.alpha

Examples


#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

imager documentation built on May 29, 2024, 1:38 a.m.