2017-04-23 6 views
1

一連のRプロットからGIFアニメーションファイルを作成したいと思います。私はImageMagickとこれを行うための "アニメーション"パッケージをインストールしました。R {animation}パッケージ[saveGIF] - 変換の代わりにmagickを使用したい

私はsaveGIF関数を使いたいですが、この関数を使うと、ImageMagickでconvert.exeを使用しようとしているときにエラーが発生します。 ImageMagickの現在のバージョンがconvert.execonvert.exeは存在しません)の代わりにmagick.exeを使用しているようです。

アニメーションパッケージを使用せずにmagick.exeを使用してImageMagickから直接GIFアニメーションを作成することができました。しかし、convert.exeの代わりにmagick.exeを使うsaveGIFを作ることができれば、より便利です。私はそれをする方法を知りたい。

ImageMagickの古いバージョンをインストールしても、まだconvert.exeが使用されていますが、これは私が探している回答ではありません。

UPDATE

私はジョシュ・オブライエンによって提案ani.optionsを試してみました。以下は私が得たものです。何が問題なのかわからない...

> ani.options(convert = 'C:/Program Files/ImageMagick-7.0.5-Q16/magick.exe') 
> 
> saveGIF(
+ for(i in 1:10){ 
+ plot(i,1,xlim=c(0,11)) 
+ } 
+) 
Executing: 
"C:/Program Files/ImageMagick-7.0.5-Q16/magick.exe -loop 0 -delay 100 Rplot1.png Rplot2.png Rplot3.png Rplot4.png Rplot5.png Rplot6.png Rplot7.png 
    Rplot8.png Rplot9.png Rplot10.png "animation.gif"" 
'C:/Program' is not recognized as an internal or external command, 
operable program or batch file. 
an error occurred in the conversion... see Notes in ?im.convert 
[1] FALSE 
Warning messages: 
1: running command 'C:\WINDOWS\system32\cmd.exe /c "C:/Program Files/ImageMagick-7.0.5-Q16/magick.exe -loop 0 -delay 100 Rplot1.png Rplot2.png Rplot3.png Rplot4.png Rplot5.png Rplot6.png Rplot7.png Rplot8.png Rplot9.png Rplot10.png "animation.gif""' had status 1 
2: In cmd.fun(convert) : 
    '"C:/Program Files/ImageMagick-7.0.5-Q16/magick.exe -loop 0 -delay 100 Rplot1.png Rplot2.png Rplot3.png Rplot4.png Rplot5.png Rplot6.png Rplot7.png Rplot8.png Rplot9.png Rplot10.png "animation.gif""' execution failed with error code 1 
3: running command '"C:/Program Files/ImageMagick-7.0.5-Q16/magick.exe -loop 0 -delay 100 Rplot1.png Rplot2.png Rplot3.png Rplot4.png Rplot5.png Rplot6.png Rplot7.png Rplot8.png Rplot9.png Rplot10.png "animation.gif""' had status 127 
+1

'ani.options(convert = '/path/to/magick.exe')'のようなものを使って実行可能ファイルへのパスを修正しようとしましたか? –

+0

@Josh O'Brienありがとうございました。出来た。 – quibble

答えて

4

ジョシュ・オブライエンの答えが働いた。 「プログラムファイル」を「PROGRA〜1」に変更する必要がありました。

ani.options(convert = 'C:/PROGRA~1/ImageMagick-7.0.5-Q16/magick.exe') 

saveGIF(
for(i in 1:10){ 
plot(i,1,xlim=c(0,11)) 
} 
) 
+0

それは私のために働いた。キーは "Program Files"ではなく "PROGRA〜1"に変更されました –

関連する問題