Learn R Programming

imager (version 0.45.8)

draw_text: Draw text on an image

Description

Like other native CImg drawing functions, this is meant to be basic but fast. Use implot for flexible drawing.

Usage

draw_text(im, x, y, text, color, opacity = 1, fsize = 20)

Value

an image

Arguments

im

an image

x

x coord.

y

y coord.

text

text to draw (a string)

color

either a vector or a string (e.g. "red")

opacity

0: transparent 1: opaque.

fsize

font size (in pix., default 20)

Author

Simon Barthelme

See Also

implot,draw_circle,draw_rect

Examples

Run this code
cimg.limit.openmp()
draw_text(boats,100,100,"Some text",col="black") %>% plot

Run the code above in your browser using DataLab