Simulating video compression artifacts and pixel bleeding effects
Datamoshing exploits video compression artifacts by manipulating I-frames (keyframes) and P-frames (motion prediction frames). When I-frames are removed, the decoder uses motion vectors from one scene applied to pixels from a completely different scene, creating surreal morphing effects.
This simulation approximates the effect by: (1) estimating motion between frames using block matching, (2) applying those motion vectors to mismatched pixel data, and (3) blending frames with intentional "corruption" to mimic codec errors.