Examples » Animated GIF new in 2020.06

Playing back an animated GIF. On the GPU or in a terminal.


Makes use of StbImageImporter's animated GIF support, the Animation library, and texture transform in Shaders::FlatGL to load and play back a short GIF animation. Additionally, there's a console version of the same, rendering the animation into a compatible terminal using Debug's color output capabilities.


Pass a path to an animated GIF file to either of the executables. A sample GIF is bundled in the repository, see the links below.

  • Space pauses / unpauses the animation in the graphical version
  • Ctrl C aborts playback in the console version



Full source code is linked below and together with assets also available in the magnum-examples GitHub repository. This example depends on the StbImageImporter plugin, which is not a part of the core Magnum repository — see its documentation for usage instructions.