Most video codecs are optimized for movies. However, not all videos look like real-world movies, and usual codecs do not aways give good results.
So are there methods specifically designed for cartoons/animated screen captures? Are there any open-source implementation?