I would like to create a high resolution “montage” of 3 by 3 using the magick
package.
library(magick)
#> Linking to ImageMagick 6.9.7.4
#> Enabled features: fontconfig, freetype, fftw, lcms, pango, x11
#> Disabled features: cairo, ghostscript, rsvg, webp
# Read the image and resize it
frink <- image_read("https://jeroen.github.io/images/frink.png")
frink <- image_resize(frink, "100x")
# Create 1 column with 3 rows
col <- image_append(rep(frink, 3), stack = TRUE)
# "Combine" 3 columns
i <- image_append(c(col, col, col))
i
So my question is how can I save it to a high-resolution png (e.g., 300 DPI)? I was thinking to use image_write()
, but apparently I can not set the resolution I want there.
# This is not working
# image_write(i, tempfile(), res = 300)
Created on 2019-05-09 by the reprex package (v0.2.1)
I had the same problem but found the solution in the magick vignett https://docs.ropensci.org/magick/articles/intro.html#read-and-write
image_write(i, path = "final.png", format = "png")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With