This is one that I've been wanting to do for a while. Full code available here.
The idea is that SVG glitch is really fun but it's probably even more fun in video. There aren't really any codecs that I know of that do vector videos though so we'll have to use the SVG image format. To be able to script everything I had to install two dependencies on my linux mint system : graphicsmagick-imagemagick-compat (maybe just imagemagick could work for you though) and autotrace to handle all these png < - - > svg conversions.