tylermorganwall / rayshader

R Package for 2D and 3D mapping and data visualization
https://www.rayshader.com/
2.05k stars 211 forks source link

Saving PNG image and 3D object #235

Closed IanWorthington closed 1 year ago

IanWorthington commented 2 years ago

I'm attempting to capture a PNG of an image produced using plot_gg().

I seem to be able to get an image using

rgl::rgl.snapshot(tempfilename)

but the documentation for this states I should be using th following to get better quality results:

snapshot3d(tempfilename, webshot = TRUE)

but this gives me a very blurry image, significantly worse than rgl.snapshot.

Could someone give me some guidance please on how to get the best quality, high resolution, capture?

Also, is there a way to capture and reload the 3d image to the viewer without having to regenerate the whole thing from scratch, which takes a little while?

tylermorganwall commented 1 year ago

Use render_snapshot() with rayshader, see the documentation here to learn more: https://www.rayshader.com/reference/render_snapshot.html