Google releases open source 'GIF for CLI' terminal tool on GitHub
Tomorrow is the GIF's 31st anniversary -- exciting, right? Those animated images have truly changed the world. All kidding aside, it is pretty amazing that the file format came to be way back in 1987!
To celebrate tomorrow's milestone, Google releases a new open source tool today. Called "GIF for CLI," it can convert a Graphics Interchange Format image into ASCII art for terminal. You can see such an example in the image above.
"Just in time for the 31st anniversary of the GIF, GIF for CLI is available today on GitHub. GIF for CLI takes in a GIF, short video, or a query to the Tenor GIF API and converts it to animated ASCII art. This means each time you log on to your programming workstation, your GIF is there to greet you in ASCII form. Animation and color support are performed using ANSI escape sequences," says Sean Hayes, Tenor.
Hayes further says, "When the command line program is run, it takes the chosen .gif file (file, url, or Tenor query) and uses ffmpeg to split the animated gif or short video into static jpg frames. Those jpg frames are then converted to ASCII art (these ASCII art frames are cached in $HOME/.cache/gif-for-cli). The program then prints one frame at a time to the console, clearing the console using ANSI escape sequences between each frame."
If you want to try GIF for CLI yourself, you can check it out on the Microsoft-owned GitHub here. While it does seem a bit silly that Google invested resources into such a tool, it does look like a lot of fun. If you do try it, the search giant invites you to share the results on Twitter using the #GIFforCLI hashtag.