>>8756485
1. Extract every frame of the animation loop.
2. Use the Difference layer mode in GIMP/Photoshop to find where all the frames overlap.
3. Crop all layers down to a single resolution where everything overlaps.
4. Export every cropped frame as an image.
5. Combine into a video file using ffmpeg.