Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

colorise

Fill in a colour in an area given by a pixset


Description

Paint all pixels in pixset px with the same colour

Usage

colorise(im, px, col, alpha = 1)

Arguments

im

an image

px

either a pixset or a formula, as in imeval.

col

colour to fill in. either a vector of numeric values or a string (e.g. "red")

alpha

transparency (default 1, no transparency)

Value

an image

Author(s)

Simon Barthelme

Examples

im <- load.example("coins")
colorise(im,Xc(im) < 50,"blue") %>% plot
#Same thing with the formula interface
colorise(im,~ x < 50,"blue") %>% plot
#Add transparency
colorise(im,~ x < 50,"blue",alpha=.5) %>% plot
#Highlight pixels with low luminance values
colorise(im,~ . < 0.3,"blue",alpha=.2) %>% plot

imager

Image Processing Library Based on 'CImg'

v0.42.10
LGPL-3
Authors
Simon Barthelme [aut], David Tschumperle [ctb], Jan Wijffels [ctb], Haz Edine Assemlal [ctb], Shota Ochi [cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.