Skip to content

Instantly share code, notes, and snippets.

View akshatdalton's full-sized avatar
🏠
Working from home

Akshat akshatdalton

🏠
Working from home
View GitHub Profile
@gstorer
gstorer / PDF_extract_images.py
Created August 1, 2018 10:15
Extract images from a PDF file using Python, Pillow (PIL) and PyPDF2
# coding=utf-8
from __future__ import print_function
"""
The MIT License (MIT)
Copyright (c) 2018 Louis Abraham <louis.abraham@yahoo.fr>
Copyright ©2016 Ronan Paixão
Copyright (c) 2018 Gerald Storer
\x1B[34m\033[F\033[F
@BigglesZX
BigglesZX / gifextract.py
Created November 5, 2012 10:31
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 -