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.

1 Answer 1

2
ffmpeg -i input.gif -vf "scale=256:-1:flags=neighbor,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" output.gif
3
  • 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: s6.gifyu.com/images/aerodactyl4bc553a6dd3fedef.gif Upscaled: s6.gifyu.com/images/aerodactyl.gif Jul 15, 2021 at 9:15
  • @jippyjoe4 Your ffmpeg is too old. Download newer ffmpeg version for Windows. Preferably using git version, not release version. Essentials will suffice, you don't need full.
    – llogan
    Jul 15, 2021 at 18:04
  • thank you, that fixed it! Jul 15, 2021 at 21:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .