powered by
Add a rectangle to an image. Like other native CImg drawing functions, this is meant to be basic but fast. Use implot for flexible drawing.
draw_rect(im, x0, y0, x1, y1, color = "white", opacity = 1, filled = TRUE)
an image
x coordinate of the bottom-left corner
y coordinate of the bottom-left corner
x coordinate of the top-right corner
y coordinate of the top-right corner
either a vector, or a string (e.g. "blue")
0: transparent 1: opaque.
fill rectangle (default TRUE)
Simon Barthelme
implot,draw_circle
draw_rect(boats,1,1,50,50,"darkgreen") %>% plot
Run the code above in your browser using DataLab