-
-
Notifications
You must be signed in to change notification settings - Fork 84
Generated GIFs are very inefficient in space #31
Comments
There are many factors to the file size. The example.gif is only 497×290 pixels, uses few colours, is short (~28 seconds) and has a low area of change between frames (easier to compress). asciicast2gif already uses gifsicle to compress the output gif, but there are more options from gifsicle that you can try. BTW the |
You can also ask @tianon how the gif was generated. |
Was a pretty standard byzanz (https://github.com/GNOME/byzanz) recording -- nothing very custom there. |
Thanks for chiming in. Cool project for GNOME users. |
Heh, I don't use GNOME -- I actually ran it inside a Docker container, and had a small wrapper script to grab the proper X, Y, width, and height for capturing the window I was interested in. It doesn't need more than the X11 socket in order to work. 👍 |
@ahmetb can you give us a link to your recording which ends up being 964kb gif? We can play with various arguments for asciicast2gif and for gifsicle. |
I've played a little with ImageMagick and gifsicle
* The scaled=1 gif is used as an input for all remaining commands |
@publicarray awesome! That's very helpful. Another things to try:
I'm thinking that maybe asciicast2gif could have a concept of "presets", probably 3 (low, normal, high) would be enough to cover everyone's needs. But before presets, I'd like to try the above. |
It'd be really cool to script these into a separate tool, or bundle in the asciicast2gif tool? |
I've implemented some optimizations:
I've pushed new version to npm, and there's new image on Docker hub ( You can set |
I've generated gif from the asciicast linked by @ahmetb using latest (today's) version, with this command:
Or Docker version:
The resulting gif is 213kb, which is a good improvement over initial 964kb. |
Thanks a bunch, that's a pretty good improvement! |
Take a look at this GIF, it goes on FOR MINUTES and it's only 32 kb:
https://github.com/tianon/gosleep/blob/master/example.gif
I'm curious why we can't we have this minimality with
asciicast2gif
? My 30 second recording is 964 kilobytes.Is there a way to minimalize this? I don't care about antialiasing and all those fancy stuff making the image larger.
The text was updated successfully, but these errors were encountered: