我想使用该magick包创建一个 3 x 3 的高分辨率 \xe2\x80\x9cmontage\xe2\x80\x9d 。
library(magick)\n#> Linking to ImageMagick 6.9.7.4\n#> Enabled features: fontconfig, freetype, fftw, lcms, pango, x11\n#> Disabled features: cairo, ghostscript, rsvg, webp\n\n# Read the image and resize it\nfrink <- image_read("https://jeroen.github.io/images/frink.png")\nfrink <- image_resize(frink, "100x")\n\n# Create 1 column with 3 rows\ncol <- image_append(rep(frink, 3), stack = TRUE)\n\n# "Combine" 3 columns\ni <- image_append(c(col, col, col))\n\ni\nRun Code Online (Sandbox Code Playgroud)\n\n
所以我的问题是如何将其保存为高分辨率 png(例如 300 DPI)?我正在考虑使用image_write(),但显然我无法在那里设置我想要的分辨率。
# This is not working\n# image_write(i, tempfile(), res = 300)\nRun Code Online (Sandbox Code Playgroud)\n\n谢谢你,\n菲尔
\n\n由reprex 包(v0.2.1)于 2019-05-09 创建
\n我遇到了同样的问题,但在 magick vignett 中找到了解决方案https://docs.ropensci.org/magick/articles/intro.html#read-and-write
image_write(i, path = "final.png", format = "png")
Run Code Online (Sandbox Code Playgroud)