1

R library rgl cannot find image magick although it is installed and executes from within a cmd shell.

So this does not work:

require(rgl)
open3d()
rgl.bringtotop()
plot3d(foo$x,foo$y,foo$thing,col =heat.colors(256)[1+round(foo$z*255)],xlab = '',ylab='',zlab='',radius=3,size=3,box=T,axes=F)
play3d(spin3d(axis = c(1, 1, 1), rpm = 10), duration = 2)
movie3d(spin3d(axis = c(1, 1, 1), rpm = 10), duration = 1)

As it barfs:

riting 'movie200.png'Writing 'movie003.png'
Error in movie3d(spin3d(axis = c(1, 1, 1), rpm = 10), duration = 20) : 
  'ImageMagick' not found
In addition: Warning message:
running command 'C:\Windows\system32\cmd.exe /c convert --version' had status 4 

The real issue here is that convert is a windows command. On Windows, I believe Imagemagick uses magick for its commands.

So I think rgl needs to use the windows command.

Any ideas?

Work around

movie3d(spin3d(axis = c(1, 1, 1), rpm = 10), duration = 12,movie='un1qu3',dir = getwd())
system('magick -delay 10 un1qu3*.png out.gif')
file.remove(grep('un1qu\\d+\\.png',list.files(),value = T))
Chris
  • 1,219
  • 2
  • 11
  • 21
  • Possible duplicate of http://stackoverflow.com/questions/37800390/linking-r-to-imagemagick. – r2evans Jun 14 '16 at 16:29
  • Nope, doesn't work: convert.exe is not in imagemagick the windows version. – Chris Jun 14 '16 at 16:50
  • They used to (I think) provide the `convert.exe` helper application that does specific actions within ImageMagick, thank you for the prod. Have you tried (per `?movie3d`) to specify the convert command directly? Perhaps `movie3d(spin3d(axis = c(1, 1, 1), rpm = 10), duration = 1, convert="/path/to/magick.exe")` would work. – r2evans Jun 14 '16 at 17:04
  • In versions previous to 7 Imagemagick used convert and it now uses magick. I have not tried but thought convert was still supported. I think the change was partially changed due to the conflict with the windows convert command. I have never had a problem with the convert command on windows but I have always let the Imagemagick intsall write the path into the environmental variables list. – Bonzo Jun 14 '16 at 17:13
  • @Bonzo: I thought the same, but I just installed the windows-specific (non-msys2) version, and the only `.exe` files are `dcraw`, `ffmpeg`, `hp2xx`, `imdisplay`, and `magick`. (I just my edited answer at [the other question](http://stackoverflow.com/questions/37800390/linking-r-to-imagemagick) based on this discussion.) – r2evans Jun 14 '16 at 17:17

1 Answers1

1

It's a bit old question, but I I've just faced the same problem, and it seems I managed to solve it.

The Rgl package was built to use the convert.exe file from Imagemagick. The problem is that the version of IM currently available for Windows does not contain this file, it uses the magick.exe instead.

What solved the problem for me was actually quite simple: go to the Imagemagick library in Program Files (or the place you installed it), find the 'magick.exe' file, and rename it to 'convert.exe'. :)

MMarton
  • 26
  • 3