QuadTree Compression for ComputerCraft Videos
A compression algorithm that converts and reduces the size of a video file very efficiently. Made for a Minecraft mod that adds computers to the game, only supports binary videos (only 2 colors).
ComputerCraft, the mod in question, has a limit of 1 MB total size storage per computer in-game. Naively storing pixels directly to bytes would be extremely wasteful, and even storing each pixel as a bit would still be very wasteful. And for this resolution, there's simply not enough redundancy for most generic compression algorithms to work well.
However, by seeing each frame as a quad tree structure and storing it in the shortest way possible, it's possible to considerably reduce file size. This is overkill for most use cases, and binary videos won't have enough colors most of the time, which is why this method isn't good for many situations. Still, it's a very efficient way to store videos for this one situation.
This project is open-source and the code can be found here.