Skip to content

Instantly share code, notes, and snippets.

tkoak /
Created Feb 23, 2017 — forked from BigglesZX/
Extract frames from an animated GIF, correctly handling palettes and frame update modes
import os
from PIL import Image
I searched high and low for solutions to the "extract animated GIF frames in Python"
problem, and after much trial and error came up with the following solution based
on several partial examples around the web (mostly Stack Overflow).
There are two pitfalls that aren't often mentioned when dealing with animated GIFs -