Skip to content

Instantly share code, notes, and snippets.

View IgorZyktin's full-sized avatar

Игорь IgorZyktin

  • Moscow
View GitHub Profile
@almost
almost / gifextract.py
Last active June 17, 2019 14:26 — forked from BigglesZX/gifextract.py
Extract frames from an animated GIF and return them from a generator, correctly handling palettes and frame update modes
import os
from PIL import Image
# Based on https://gist.github.com/BigglesZX/4016539 (but adapted to be a
# generator that yields frames instead of a function that saves out frames)
'''
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).