interactive_annotate: interactive annotation

View source: R/interactive_annotate.R

interactive_annotateR Documentation

interactive annotation

Description

Using image_annotate of 'magick' interactively. location, degrees, size, weight, and kerning are parameters of image_annotate. See reference manual of 'magick' for detail.

Usage

interactive_annotate(
  image,
  text,
  gravity = "northwest",
  font = "",
  style = "normal",
  decoration = NULL,
  color = NULL,
  strokecolor = NULL,
  boxcolor = NULL,
  range_max_size = 1000,
  range_max_weight = 850,
  range_max_kerning = 300,
  resolution = 0.1,
  return_param = FALSE,
  scale
)

Arguments

image

a magick image object

text

character vector of length equal to 'image' or length 1

gravity

string with gravity value from gravity_types.

font

string with font family such as "sans", "mono", "serif", "Times", "Helvetica", "Trebuchet", "Georgia", "Palatino" or "Comic Sans".

style

value of style_types for example "italic"

decoration

value of decoration_types for example "underline"

color

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

strokecolor

a color string adds a stroke (border around the text)

boxcolor

a color string for background color that annotation text is rendered on.

range_max_size

define maximum of size in slider. must be positive.

range_max_weight

define maximum of weight in slider. must be positive.

range_max_kerning

define maximum of kerning in slider. must be positive.

resolution

resolution of slider

return_param

If return_param is TRUE, returns a list of values of location, degrees, size, weight, and kerning. 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 location, degrees, size, weight, and kerning

Author(s)

Shota Ochi

Examples


if (interactive())
{
  interactive_annotate(wizard, "hello")
}


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