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

bucketfill

Bucket fill


Description

Bucket fill

Usage

bucketfill(
  im,
  x,
  y,
  z = 1,
  color,
  opacity = 1,
  sigma = 0,
  high_connexity = FALSE
)

Arguments

im

an image

x

X-coordinate of the starting point of the region to fill.

y

Y-coordinate of the starting point of the region to fill.

z

Z-coordinate of the starting point of the region to fill.

color

a vector of values (of length spectrum(im)), or a colour name (e.g. "red"). If missing, use the colour at location (x,y,z).

opacity

opacity. If the opacity is below 1, paint with transparency.

sigma

Tolerance for neighborhood values: spread to neighbours if difference is less than sigma (for grayscale). If there are several channels, the sum of squared differences is used: if it below sigma^2, the colour spreads.

high_connexity

Use 8-connexity (only for 2d images, default FALSE).

See Also

px.flood

Examples

#Change the colour of a sail 
boats.new <- bucketfill(boats,x=169,y=179,color="pink",sigma=.2) 
layout(t(1:2))
plot(boats,main="Original")
plot(boats.new,main="New sails")

#More spreading, lower opacity, colour specified as vector
ugly <- bucketfill(boats,x=169,y=179,color=c(0,1,0),sigma=.6,opacity=.5)
plot(ugly)

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.