合并povray的任意大小的部分图像
起始情况:
使用 povray 创建场景的 4 个部分图像。
povray +SR1 +ER200 +SC0 +EC200 +W400 +H400 +OPART1 povray.pov
povray +SR1 +ER200 +SC201 +EC400 +W400 +H400 +OPART11 povray.pov
povray +SR201 +ER400 +SC0 +EC200 +W400 +H400 +OPART2 povray.pov
povray +SR201 +ER400 +SC201 +EC400 +W400 +H400 +OPART22 povray.pov
要解决的问题:
- 以编程方式合并 4 个图像。
需要考虑的事项:
- 大多数部分图像不是有效图像,无法打开。例如,可以打开第一部分图像,显示一个矩形,图像位于左上角,其他所有内容都是黑色的。但其余图像仅包含有关他所在区域的信息。我们可以说这些图像已经被破坏了。
- 输出格式用 +F 设置,可以是 PPM、PNG、未压缩和压缩 Targa。有效的解决方案可以使用这些格式中的任何一种。
- 重点关注如何合并图像。您知道每个部分图像所具有的矩形。
已尝试过的事情:
- 按照 http://povray.tashcorp.net/ 中所述将图像与 Tail 连接起来教程/qd_multicpu_render/ 。仅当部分图像在宽度轴上完整时,它才有效,也就是说,如果 PART1 是一组线,PART2 是另一组线......并且没有列划分。但我们有列划分。
- 使用 ImageMagick。无法打开部分图像。它说它们坏了。
Starting situation:
Using povray I create 4 partial images of a scene.
povray +SR1 +ER200 +SC0 +EC200 +W400 +H400 +OPART1 povray.pov
povray +SR1 +ER200 +SC201 +EC400 +W400 +H400 +OPART11 povray.pov
povray +SR201 +ER400 +SC0 +EC200 +W400 +H400 +OPART2 povray.pov
povray +SR201 +ER400 +SC201 +EC400 +W400 +H400 +OPART22 povray.pov
Problem to solve:
- Merge the 4 images programmatically.
Things to take in consideration:
- Most of the partial images are NOT valid images and cannot be opened. For example, the first partial image can be opened, showing a rectangle with the image at the top left and everything else is black. But the rest of the images contain only the information regarding his zone. We could say that those images are broken.
- The output format is set with the +F and could be PPM, PNG, Uncompressed and Compressed Targa. A valid solution could use any of those formats.
- Focus on how to merge the images. You know the rectangle that each partial image have.
Things that have been tried:
- Concatenating the images with Tail as described in http://povray.tashcorp.net/tutorials/qd_multicpu_render/ . It only works if the partial images are complete on the width axis, that is if PART1 is a set of lines, PART2 another set of lines...and no column division. But we have column division.
- Use ImageMagick. It cannot open the partial images. It says they are broken.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了如何实现这一目标。
您需要修补 Povray,以便它保存有关 PNG 文件的偏移量的信息。
这就是补丁。
https://gist.github.com/721862
您需要下载 povray 的源代码并应用补丁。要应用补丁,请将补丁文件保存在 povray-3.6.1/source/patch.patch 中,然后:
I found how this could be achieved.
You need to patch Povray so that it saves information about the offset of PNG files.
This is the Patch.
https://gist.github.com/721862
You need to download the sources for povray and apply the patch. To apply the patch you save the patch file in povray-3.6.1/source/patch.patch and then: