Menu

Extracting GIF frames in the browser without uploading the file
πŸ“°

Extracting GIF frames in the browser without uploading the file

DEV Community: javascriptΒ·ZengziheΒ·5 days ago
#cgspgu6Z
#devtojavascript#devto#dev#frame#canvas
Reading 0:00
15s threshold

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.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.