Text color not honored by image_annotate() using Windows magick package in R
bevanward opened this issue · 0 comments
bevanward commented
When adding text to an image in R the color is not honored and is always black.
This works in Linux however not in windows.
To reproduce the error the following code shows the issue.
Thanks
library(magick)
height <- 100
width <- 80
X <- array(
runif(height * width * 3, min = 0, max = 255),
dim = c(height, width, 3)
)
img <- magick::image_read(X / 255) %>% magick::image_scale("500x400")
img <- magick::image_annotate(img, text = "Example", gravity = "northeast", location = "+50+50", font = "times", size ="20", color = "white")
print(img)
image_write(img, path = "c:/temp/ouput.png")