增加R射线阴影图像的分辨率 [英] Increase resolution of R rayshader image

查看:54
本文介绍了增加R射线阴影图像的分辨率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用rayshader软件包制作图像.我很高兴能够使用如下代码创建png文件:

I'm trying to make an image using rayshader package. I've been happy that I've been able to create a png file using code like so:

library(ggplot2)
library(rayshader)

example_plot <- 
  ggplot(data.frame(x=c(1,2,3),y=c(4,5,6),z=c(5,4,3)),aes(x=x,y=y,color=z)) + geom_point()

plot_gg(example_plot, width = 2, height = 2, multicore = TRUE, scale = 125, 
        zoom = 0.5, phi = 60, theta=-10, windowsize = c(3200, 3200), offset_edges = TRUE)

Sys.sleep(2.0)

render_depth(focus = 0.5, focallength = 100, fstop = 8, clear = TRUE,filename="example.png")

不幸的是,我不知道如何使输出图像具有更高的分辨率.我尝试过调整windowsize的值,该值在低值时可能会有所不同,但是我遇到了某种天花板,在该天花板上输出图像的分辨率不会超过1372 x893.我该怎么办才能获得输出分辨率为3200 x 3200的图像?

Unfortunately, I can't figure out how to make the output image be a higher resolution. I've tried adjusting the windowsize which at low values seems to make a difference, but I've hit some sort of ceiling where the resolution of the output image won't go above 1372 x 893. What can I do to get an output image that is around 3200 x 3200 resolution?

谢谢!

推荐答案

当前, rayshader rgl 的限制,因为它不支持大于分辨率的设备尺寸屏幕的.我在1440p显示器上对其进行了测试,并且能够获得 render_snapshot()来创建图像2564x1421(大约是1440p显示器的分辨率).如果您的显示器支持更高的分辨率,则可以通过临时提高桌面分辨率来增加快照大小.否则,它目前是一个限制(请参阅此github问题):

Currently, rayshader is limited by rgl's lack of support for device sizes greater than the resolution of the screen. I tested it out on my 1440p monitor, and I was able to get render_snapshot() to create an image 2564x1421 (approximately the resolution of a 1440p monitor). If your monitor supports higher resolutions, you may be able to increase the snapshot size by temporarily increasing your desktop resolution. Otherwise, it's currently a limitation (see this github issue):

https://github.com/tylermorganwall/rayshader/issues/28

但是,如果您有时间/耐心并且不介意它生成的图像类型稍有不同,则 render_highquality()使用完全不同的渲染引擎,并且可以将其设置为任何大小的输出.调用该函数时,只需将 width height 参数设置为所需的大小即可.

However, if you have the time/patience and don't mind the slightly different type of image it produces, render_highquality() uses a completely different rendering engine and can be set to any size output. Just set the width and height arguments to the desired size when calling that function.

这篇关于增加R射线阴影图像的分辨率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆