Using R to convert png files to animation

1.4k views Asked by At

I have a number of png files and now like to covert these files into an animation using R. I did the following thus for Install ImageMagick for Windows ( which is located C:\Program Files\ImageMagick-6.9.1-Q16)

library(animation)
setwd("C:/Users/j/Desktop/CAN/New folder")
# reading my png files
bm.files = sprintf("min%i.png", 1:20)
head(bm.files)
[1] "min1.png" "min2.png" "min3.png" "min4.png" "min5.png" "min6.png"
# 
ani.options(convert = 'C:\\Program Files\\ImageMagick-6.9.1-Q16\\convert.exe')
# try to convert to gif
im.convert(files = bm.files, output = "bm-animation3.gif")

After running the above I got the following errors
convert.exe: no decode delegate for this image format PNG' @ error/constitute.c/ReadImage/501. convert.exe: no images definedbm-animation3.gif' @ error/convert.c/ConvertImageCommand/3212

I looked at solutions to my issue on error in saveGIF command in animation package and several others places but not any closer to a solution. Any guidance to fix would be most helpful

0

There are 0 answers