ImageMagick中的转换在哪里? [英] Where is convert in ImageMagick?

查看:70
本文介绍了ImageMagick中的转换在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是度过了令人发指的一天,试图用R中的一系列jpg文件制作gif文件.我安装了ImageMagick来运行以下代码:

  system("convert -delay 40 * .png example_4.gif") 

但是我收到以下错误消息:

 警告消息:运行命令'convert -delay 40 * .png example_4.gif'的状态为4 

,看起来像是路径错误.现在,我在Imagemagick下载中寻找了convert,在任何地方都看不到它.有人知道它在哪里吗?

或者,还有另一种更简单的方法,可以从R中的一系列jpeg中创建一个gif,长度不是可笑的吗?

谢谢

解决方案

三个选项:

  1. 考虑使用

此更改自7.0.1(至今已达到7.0.7)以来一直存在,并在其移植指南,特别是在标题为命令更改"的部分中.

从哲学上讲,我宁愿安装旧版实用程序,主要是因为它会导致与命令名的混淆.例如,Windows中的非ImageMagick convert.exe 尝试转换文件系统...可能不是您要意外触发的文件(极少有机会使参数正确实际上进行了更改,但仍然不是0).您在 PATH 中的目录顺序将决定您要呼叫的对象.

编辑:

  1. 从注释中看,静态"安装程序和"dll"安装程序之间的差异似乎可能会禁用安装旧版实用程序(如 convert.exe )的选项.因此,您可以切换到"dll"以获取旧版选项,或者您只能使用选项1( magick R包)和2("magick convert ..." ).

  2. 根据其他评论(感谢fmw42和MarkSetchell),很明显,旧的 convert.exe 和当前的传统模式 magick.exe会转换与当前推荐的 magick.exe 不同(不带转换");前两个是传统模式和兼容模式,但是它们不接受 magick -alone当前支持的所有参数.因此,在命令中的任何地方使用"convert" 都应指示使用v6,而不是当前的v7.那么,这个答案仅仅是继续使用v6机制的补丁.有人可能会说,更好的解决方案是使用 magick.exe 的v7界面,完全删除转换"旧版模式.

I just spent an infuriating day trying to make a gif out of a series of jpg files in R. I installed ImageMagick to run the following code:

system("convert -delay 40 *.png example_4.gif")

but I get the following error message:

Warning message:
running command 'convert -delay 40 *.png example_4.gif' had status 4

which looks like a path error. Now I've looked for convert in the Imagemagick download and can't see it anywhere. Does anyone know where it is?

Alternately, is there another easier method of making a gif from a series of jpegs in R that isn't ridiculously long?

Thanks

解决方案

Three options:

  1. Consider using the magick R package instead of using system().
  2. Change your script from convert ... to magick convert ....
  3. Re-install imagemagick, and enable the "Install legacy utilities (e.g. convert)" option.

This change has been around since 7.0.1 (now up to 7.0.7), and is discussed in their porting guide, specifically in the section entitled "Command Changes".

Philosophically, I prefer to not install the legacy utilities, mostly because it can cause some confusion with command names. For instance, the non-ImageMagick convert.exe in windows tries to convert a filesystem ... probably not what you want to accidentally trigger (there is a very low chance that you could get the arguments right to actually make a change, but it's still not 0). The order of directories in your PATH will dictate which you are calling.

EDITs:

  1. From comments, it seems like the difference between "static" and "dll" installers might disable the option to install legacy utilities such as convert.exe. So you can either switch to the "dll" to get the legacy option, or you are restricted to options 1 (magick R package) and 2 ("magick convert ...").

  2. From further comments (thanks to fmw42 and MarkSetchell), it is clear that the old convert.exe and the current legacy mode of magick.exe convert are not the same as the currently recommended magick.exe (without "convert"); the first two are legacy and compatibility modes, but they do not accept all arguments currently supported by magick-alone. So the use of "convert" anywhere in the command should indicate use of v6, not the current v7. This answer is then merely a patch for continued use of the v6 mechanisms; one could argue a better solution would be to use magick.exe's v7 interface, completely removing the "convert" legacy mode.

这篇关于ImageMagick中的转换在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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