Closed dschneiderch closed 4 years ago
OK I see the issue. It is not setting the density attribute correctly, but actually it is using the density, if you look at the size of the output image.
I'll try to fix it so that it also sets the attribute correct, but it really doesn't matter much. What matters is the resolution of the image; dpi is just an attribute.
Seems like reading a pdf into magick through pdftools always comes in as 72 dpi
Just
pdf_render_page
seems to work without errors:image_read
works ok thoughin the case of
pdftools::pdf_render_page(npqleg, dpi=288, antialias=T) %>% png::writePNG('test2.png', dpi=288)
why doesimage_read('test2.png')
return an image with density 113? I expected ether 288 or 72. If i open test2.png in an image viewer it recognizes it to have dpi=288.npq_legend.pdf
context
I'm trying to put together several plots from matplotlib that are formatted like npq_legend above. I have the figures saved as rasters at 100 dpi, but i'm trying to get a better legend so I saved a single copy as a pdf. i'm trying to follow this advice of supersampling to get decent text. http://www.imagemagick.org/discourse-server/viewtopic.php?p=54853&sid=1525b3ad11155f1b4ff1ad4d0a76ca5e#p54853
this is what i'm trying to crop: