I've made it. Look at the end of the post.
Hello,
I'm looking for a R library which will allow me to create an RGB array of an image consisting of multiple rectangles. Each rectangle has it's own color, position and transparency.
I should be able to define dimensions, and rectangles, and get RGB array representing image with defined rectangles.
I've read Raster and Imager vignettes and part of doc, but none seems to meet requirements.
Is it possible to do such thing in raster or imager, or should I use some other lib?
Thank you in advance!
Edit:
I've found this https://dahtah.github.io/imager/imager.html#how-images-are-represented
I've made it. I think code is pretty straight forward:
width <- height <- 300
cimg(array(1, c(width,height,1,3))) -> img1
x0 <- y0 <- 1
x1 <- y1 <- 40
draw_rect(img, x0, y0, x1, y1, opacity = 1, color="BLACK",filled = TRUE) -> img1