0

I want to upscale a .gif file with nearest neighbor interpolation on Windows from commandline (I am scaling by integer multiples). I have tried gifsicle 1.92 but for some reason it doesn't work correctly and outputs a corrupted file (it cannot be viewed). This is the input file and the command I'm using:

input gif

./gifsicle.exe --resize 256x174 --resize-method sample abomasnow.gif > out.gif

I get a 497 KB output file that cannot be viewed in any gif viewer. What am I doing wrong? I'm also open to using ffmpeg or other tools if it's not possible with gifsicle.

joejoejoejoe4
  • 1,438
  • 9
  • 25
  • 48

1 Answers1

2
ffmpeg -i input.gif -vf "scale=256:-1:flags=neighbor,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" output.gif
llogan
  • 57,139
  • 15
  • 118
  • 145
  • Thanks, after using for a while, some of the .gif frames in certain rare situations seem to be corrupted using this command: `gif_cmd = f'ffmpeg -i {os.path.abspath(gifpath)} -y -vf "scale=w={final_width}:h={final_height}:-1:flags=neighbor,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" {final_outpath}'` For example, look how the wings get stuck for multiple frames near the edges. Here are the links: Original: https://s6.gifyu.com/images/aerodactyl4bc553a6dd3fedef.gif Upscaled: https://s6.gifyu.com/images/aerodactyl.gif – joejoejoejoe4 Jul 15 '21 at 09:15
  • @jippyjoe4 Your ffmpeg is too old. [Download newer ffmpeg version for Windows](https://www.gyan.dev/ffmpeg/builds/). Preferably using git version, not release version. Essentials will suffice, you don't need full. – llogan Jul 15 '21 at 18:04
  • thank you, that fixed it! – joejoejoejoe4 Jul 15 '21 at 21:49