Closed jeroen closed 6 years ago
I cannot run this example examples/spinner-ex.R, do you know how to pass any extra.opts
to magick package
?
It depends on which option you're trying to set. The image_animate()
has a dispose
argument, I think that's what you're using in this example?
Do you know if there is a better way to implement extra.opts with image_animate()
? It has been a long time ago, since I try to use image_animate()
to instead of calling ImageMagick using shell. But I want to keep provide extra.opts
in this function, users can call other ImageMagick parameter such as dispose
, resize
, and colors
in it.
I added automatic parsing of the -dispose
parameter from the extra.opts
argument vector.
Which other image transformations do you need to support? Afaik the size and colors of the images are set via the graphics device parameters rather than the png -> gif
conversion?
Have you tested the example above? I still cannot run it because this ani.dev = function(...) png(bg = "transparent", ...)
Error in as.character(pattern) : cannot coerce type 'closure' to vector of type 'character'
extra.opt
supports user to do some image transformations like --colors 256
, -coalesce
, and -resize 300x400
.
I guess the yihui provides extra.opts
because some users want to adjust images and generate the gif in the same time.
@yihui Could we remove extra.opts
? if we only accept parameters in image_animate()
, we can avoid ImageMagick
dependencies problem, and other small problems like system -> system2
(#111) .
@yulijia I'm fine to remove it if we didn't use it anywhere in this package. A safer strategy is to document the limitation of this argument in case of convert = 'magick'
.
@yulijia I think the example was broken already before this PR. I am getting the same error in the master branch.
@jeroen Sure, I just figure out what happened. Sorry for the disturb.
Keeping the dispose parameter is useful because it is part of the animation procedure. However other parameters are general image transformations, they don't need to be part of the png -> gif
function.
I totally agree. Thank you @jeroen , you help me a lot.
See discussion in https://github.com/yihui/animation/issues/85. Use the 'magick' package to convert to gif, which does not require installing and shelling out to im/gm executables.
This prevents all the problems with finding the path to convert and escaping shell arguments. It is a bit faster too. Here is a quick benchmark: