Linux – How to Increase the Resolution of a GIF Image?

How to Increase the Resolution of a GIF Image?… here is a solution to the problem.

How to Increase the Resolution of a GIF Image?

How can I increase the resolution of a GIF image generated by R’s RGL package (plot3D and movie3D functions) – externally or via R?

R code:

MyX<-rnorm(10,5,1)
MyY<-rnorm(10,5,1)
MyZ<-rnorm(10,5,1)
plot3d(MyX, MyY, MyZ, xlab="X", ylab="Y", zlab="Z", type="s", box=T, axes=F)
text3d(MyX, MyY, MyZ, text=c(1:10), cex=5, adj=1)
movie3d(spin3d(axis = c(0, 0, 1), rpm = 4), duration=15, movie="TestMovie",
                                                type="gif", dir=("~/Desktop"))

Output:

Output
Update

Adding this line at the beginning of the code solved the problem

r3dDefaults$windowRect <- c(0, 100, 1400, 1400) 

Solution

I don’t think you can do much about the resolution of the GIF itself. I think as an alternative, you have to make the image bigger and then it will look better when you display it smaller. This is untested because the recent upgrade broke a thing or two for me, but this does work under 2.15 :

par3d(windowRect = c(0, 0, 500, 500)) # make the window large
par3d(zoom = 1.1) # larger values make the image smaller

# you can test your settings interactively at this point

M <- par3d("userMatrix") # save your settings to pass to the movie

movie3d(par3dinterp(userMatrix=list(M,
    rotate3d(M, pi, 1, 0, 0), 
    rotate3d(M, pi, 0, 1, 0) ) ), 
    duration = 5, fps = 50,
    movie = "MyMovie")

HTH。 If it doesn’t quite work for you, check the features you use and adjust the settings.

Related Problems and Solutions