一連のRプロットからGIFアニメーションファイルを作成したいと思います。私はImageMagickとこれを行うための "アニメーション"パッケージをインストールしました。R {animation}パッケージ[saveGIF] - 変換の代わりにmagickを使用したい
私はsaveGIF
関数を使いたいですが、この関数を使うと、ImageMagickでconvert.exe
を使用しようとしているときにエラーが発生します。 ImageMagickの現在のバージョンがconvert.exe
(convert.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
'ani.options(convert = '/path/to/magick.exe')'のようなものを使って実行可能ファイルへのパスを修正しようとしましたか? –
@Josh O'Brienありがとうございました。出来た。 – quibble