0

I am trying to make a gif out of 1,233 pngs.

I am trying:

png_files <- list.files("E:/S3_Backup_Anna/S3_L1/Subset_S3_L1/subset_pngs_rename", pattern = ".*png$")

gifski(png_files, gif_file = "subset_L1.gif",width = 800, height = 600, delay = 1)

I keep getting an error:

Frame 3 (0%)Failed to add frame 3
Frame 4 (0%)Error in gifski(png_files, gif_file = "subset_L1.gif", width = 800, height = 600,  : 
  Failure writing image E:\S3_Backup_Anna\S3_L1\Subset_S3_L1\subset_pngs_rename\subset_L1.gif

Does anyone know what I am doing wrong?

  • Try to make this [reproducible](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example), possibly with images that ship with a related package (don't actually know if that's a thing). Right now, best anybody could do is guess – camille Dec 19 '19 at 20:00
  • I'm unable to upload the png files i'm working with but any png files could be used to test this code I think? – Anna Windle Dec 19 '19 at 20:58
  • 1
    Hey Anna, it works for me.. with say 3 png files. Something wrong with one of your pngs? png_files[3] maybe? – StupidWolf Dec 19 '19 at 21:35
  • For reference, i used: for(i in levels(iris$Species)){ png(paste0("iris.",i,".png")); plot(iris[,1:2],col=factor(iris$Species %in% i));dev.off()} ; png_files <- list.files(pattern="iris[^ ]*png$") ; gifski(png_files, gif_file = "iris.gif",width = 800, height = 600, delay = 1) – StupidWolf Dec 19 '19 at 21:37
  • Not sure what's going on.. my PNGs are different sizes but I don't think that matters? I keep getting the "Failure writing image" error after everything I try. Is there another gif command I can try? – Anna Windle Dec 21 '19 at 21:24
  • The PNGs must have the same size. – Stéphane Laurent Feb 11 '20 at 14:06

0 Answers0