interactive_fill: interactive filling

View source: R/interactive_fill.R

interactive_fillR Documentation

interactive filling

Description

Using image_fill of 'magick' interactively. point and fuzz are parameters of image_fill. See reference manual of 'magick' for detail.

Usage

interactive_fill(
  image,
  color,
  refcolor = NULL,
  resolution = 0.1,
  return_param = FALSE,
  scale
)

Arguments

image

a magick image object

color

a valid color string such as "navyblue" or "#000080". Use "none" for transparency.

refcolor

if set, fuzz color distance will be measured against this color, not the color of the starting point. Any color (within fuzz color distance of the given refcolor), connected to starting point will be replaced with the color. If the pixel at the starting point does not itself match the given refcolor (according to fuzz) then no action will be taken.

resolution

resolution of slider of fuzz

return_param

If return_param is TRUE, returns a list values of point and fuzz. If return_param is FALSE, returns a magick image object.

scale

geometry to be passed to image_scale function of magick package. image is scaled just for preview and result image is not scaled if scale is given.

Value

a magick image object or a list of values of point and fuzz

Author(s)

Shota Ochi

Examples


if (interactive())
{
  interactive_fill(wizard, "black")
}


magickGUI documentation built on Sept. 11, 2023, 5:06 p.m.