yihui / animation

A gallery of animations in statistics and utilities to create animations
https://yihui.org/animation/
206 stars 60 forks source link

res argument is totally necesary for png-based gifs #99

Closed LuisLauM closed 7 years ago

LuisLauM commented 7 years ago

Hello

I think that you could implement res argument in order to imrpove gifs which are built from png.

yulijia commented 7 years ago

What is res stand for ? resize or resolution ? Do you ever try use extra.opts in saveGIF() in the animation package(development version)? It is used to add extra options of ImageMagick.

LuisLauM commented 7 years ago

res is the argument for resolution in png. I have explored extra.opts but it is for extra commands in ImageMagick call. If res was implementd it would be in the form of ani.res (similar to ani.width and ani.height), I think.

yulijia commented 7 years ago

I am sorry that I cannot get your point. Could you give me an example, what kind of problem you meet by now without res function?

Could you mind describe the function of res? how does it work ? It seems that you need a resolution converter for single png picture?

LuisLauM commented 7 years ago

res is not a function, is an argument of png function that controls the resolution (in ppi). For example, if you want to set the resolution of a png plot in 150ppi, you must use:

png(filename = "myFig.png", width = 1500, height = 1200, res = 150)
# Lines for my plot
dev.off()

The problem that I describe is about saveGIF does not allow (or at least I do not know the way) to modify the resolution of the plots used for building the gif.

yulijia commented 7 years ago

Thank you. We will consider it.

We need improve ani.dev() function, add resolution and customize background (issue #91)