【问题标题】:Draw a circle on empty canvas in R magick在 R magick 的空画布上画一个圆圈
【发布时间】:2021-12-01 18:18:49
【问题描述】:

我想创建一个特定尺寸(1920×1080)的空(白色)画布。在该画布上,我想在特定坐标(例如 480、123)处放置一个实心圆。

即使通过小插图 (https://docs.ropensci.org/magick/articles/intro.html),我也无法创建这样的图像。

答案需要在 R 中工作。

【问题讨论】:

    标签: r imagemagick


    【解决方案1】:

    这个适合我

    library(magick)
    img <- image_blank(width = 1920, height = 1080, color = "none")
    drawing <- image_draw(img)
    symbols(480, 123, circles = 5, bg = 'black', inches = FALSE, add = TRUE)
    dev.off()
    # displaying
    # print(drawing)
    # saving
    image_write(drawing, "img.png")
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-22
      • 2015-10-22
      • 1970-01-01
      • 1970-01-01
      • 2022-09-27
      • 2011-07-25
      相关资源
      最近更新 更多