Most online GIF tools ask you to upload the file. For a quick crop or a frame export, that is a strange trade: the file is often small, the task is simple, and it may contain something you would rather not send to a stranger's server.
I built gifkit as a browser-only alternative. The compression and cropping parts are straightforward. Frame extraction was not. This post is about why.
GIF is a compositing format, not a frame sequence
It is tempting to treat a GIF as a list of images. Real GIFs do not work that way.
A GIF has a logical screen (the canvas), and each frame is a rectangle placed somewhere on that canvas. A frame can be smaller than the canvas, can have an offset, and can use transparency.β¦