如何让 RMagick 将图像包裹在圆柱体周围?
我正在尝试在 RMagick (ImageMagick) 中将图像包裹在圆柱体周围,但遇到了困难。有几种类型的扭曲(桶形、弧形、仿射等)似乎是一个好的开始,但没有什么真正适合。我还发现了很多复杂的命令行内容(带有复杂的数学),但这对我使用 RMagick 没有多大帮助。 Fred 的 ImageMagick 脚本包含一个 rylize 脚本,但它非常复杂并且做了很多事情命令行操作,我在转换为 RMagick 调用时遇到问题。
有没有人以前做过这个或者可以将 ImageMagick 命令行转换为 RMagick 调用?
I'm trying to wrap an image around a cylinder in RMagick (ImageMagick) and am having a tough time. There are several types of distortions (Barrel, Arc, Affine, etc.) that seem to be a good start but nothing really fits. I also uncovered a lot of complicated command line stuff (with complex math) but that doesn't help me much with RMagick. Fred's ImageMagick scripts contain a cylinderize script but it is pretty complex and does a lot of command line manipulation that I'm having trouble converting to RMagick calls.
Is there anyone out there that has done this before or can convert ImageMagick command lines to RMagick calls?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只是为了借鉴 Ian 指出的——当你必须进行 ImageMagick 调用时,花钱是绝对可以的。 ImageMagick 因导致内存泄漏和 GC 问题而闻名。
在我支持的一个非常大的生产系统中,成像系统明确不与 IM 链接。相反,他们有一个表达式生成器类,可以构造正确的 shell 命令来进行转换。这是更多的工作,但也更稳定。
Just to piggyback on what Ian pointed out - it is absolutely okay to shell out when you have to do ImageMagick calls. ImageMagick is known for causing memory leaks and GC problems.
In one very large production system I supported, the imaging system explicitly did not link against IM. Instead, they had an expression builder class that would construct the right shell command to do the conversion. It was more work, but also more stable.