Writing an Asciinema to Gif Tool

I've got a work-in-progress attempt at producing the GIF with a consistent frame rate and it does indeed fix the timing issues. I simply sample the terminal screen every 0.1 seconds ( a configurable interval ) and discard all of the frames in between. Unfortunately, I think this makes certain flickering behavior unavoidable on certain applications ( which are hopefully somewhat rare in practice ). The issue is that if you are not sampling all of the frames, you have to discard some, and there is no way for me to know which frames in between to keep. That means that if something, like the progressbar in the GIF below, flashes on an off very quickly, while you would not necessarily see it in real life, you will see it in the GIF because of the limited frame rate:

The only possible way around this I can think of would be to blend the discarded frames, but I don't think that would look right either so I don't think it is worth the work.

I think that that will work fine as soon as I fix another threading issue.

Then there are some other niceties to add in priority order:

  • Support for changing the output resolution
  • Support for custom SVG templates to allow you to style the output
  • Support for rendering animated PNGs
  • Support for rendering animated SVGs

Edit: Dealt with the perceived threading issue ( just by adding an implementation note :slight_smile: ). It should be basically working now.

4 Likes