painting: Image Painting

Description Usage Arguments Details See Also Examples

Description

The image_fill() function performs flood-fill by painting starting point and all neighboring pixels of approximately the same color. Annotate simply prints some text on the image.

Usage

1
2
3
4
5
image_fill(image, color, point = "1x1", fuzz = 0)

image_annotate(image, text, gravity = "northwest", location = "+0+0",
  degrees = 0, size = 10, font = "", color = NULL,
  strokecolor = NULL, boxcolor = NULL)

Arguments

image

magick image object returned by image_read() or image_graph()

color

a valid color string such as "navyblue" or "#000080"

point

a geometry_point string indicating the starting point of the flood-fill

fuzz

Fuzz percentage: value between 0 and 100. Relative distance between colors to be considered similar in the filling algorithm.

text

annotation text

gravity

string with gravity value from gravity_types.

location

geometry string with location relative to gravity

degrees

rotates text around center point

size

font-size in pixels

font

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

strokecolor

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

boxcolor

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

Details

Note that more sophisticated drawing mechanisms are available via the graphics device using image_draw.

See Also

Other image: _index_, analysis, animation, attributes, color, composite, device, edges, editing, effects, fx, geometry, morphology, ocr, options, segmentation, transform, video

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
 <- image_read("logo:")
 <- image_background(, 'white')
image_fill(, "pink", point = "+450+400")
image_fill(, "pink", point = "+450+400", fuzz = 25)
# Add some text to an image
image_annotate(, "This is a test")
image_annotate(, "CONFIDENTIAL", size = 50, color = "red", boxcolor = "pink",
 degrees = 30, location = "+100+100")

# Setting fonts requires fontconfig support (and that you have the font)
image_annotate(, "The quick brown fox", font = "monospace", size = 50)

ropensci/magick documentation built on Jan. 15, 2019, 3:27 a.m.