By · Updated

GIF Frame Extractor

Save Any Frame of an Animated GIF as a Lossless PNG, With Frame Delays

No ratings yet

OneTask is free, with no sign-up, and built by one person.
If this tool saved you time, a coffee helps keep new ones coming.

How the GIF Frame Extractor works

This GIF frame extractor pulls any single frame out of an animated GIF. Drop in an animated GIF and pick a frame number to see that frame rendered exactly as a player would show it, then download it as a lossless PNG. The GIF is decoded here in your browser — block structure, LZW compression and all — so nothing is uploaded anywhere.

How the GIF frame extractor decodes a frame

A GIF is not a video file, it is a container holding a sequence of images with instructions for stacking them. Each frame has its own position and size within the overall canvas, its own optional colour table of up to 256 entries, a delay in hundredths of a second, and a disposal method telling the player what to do with the canvas before the next frame arrives. That structure is why pulling a single frame out of a GIF is less obvious than it sounds.

Most frames are not whole pictures. GIF encoders optimise aggressively: after the first frame, each subsequent frame usually covers only the rectangle that actually changed, with everything else left transparent so the previous content shows through. Extract that rectangle on its own and you get a small fragment on a transparent background, not the image you expected. This tool composites properly — it replays every frame from the first up to the one you asked for, honouring each frame's position and disposal method, so what you download is what you would have seen at that moment of the animation.

The three disposal methods. "Leave in place" keeps the frame on the canvas for the next one to draw over, which is how optimised GIFs accumulate. "Restore to background" wipes the frame's rectangle back to transparent, which is how frames with moving transparent areas avoid smearing. "Restore to previous" rewinds the canvas to what it was before the frame was drawn, which is rare and poorly supported but still legal. Getting these wrong is the usual reason an extracted frame looks like a trail of ghosts.

LZW, decoded here. The pixel data in each frame is a stream of variable-width LZW codes packed least-significant-bit first, with a dictionary that resets whenever a clear code appears and a code width that grows from the minimum up to twelve bits as the dictionary fills. Interlaced GIFs additionally store their rows in four passes so a slow connection could show a coarse version early. All of that is handled, which is why no server is needed: the decoder is a few hundred lines of JavaScript running on your machine.

Frame delays are approximate. The delay field is in hundredths of a second, so the finest interval a GIF can express is 10 ms, and by convention a delay of 0 or 1 is treated as roughly 100 ms by browsers rather than as "run as fast as possible". The delay shown for each frame is the raw value from the file, and the total duration uses 100 ms wherever a frame declares nothing usable. If you are converting a GIF to video, these numbers are what you need to reconstruct the timing.

PNG out, always. A GIF frame has at most 256 colours and may be partly transparent, both of which PNG represents exactly. The exported file is therefore pixel-identical to the decoded frame, with no recompression or colour loss.

FAQ

Why is my extracted frame mostly transparent?

It would be, if frames were pulled out in isolation — optimised GIFs store only the changed rectangle. This tool composites each frame over the ones before it, so you get the full picture rather than the fragment.

How do I find the number of frames?

Drop the GIF in and the frame count appears immediately alongside the canvas size, loop count and total duration. Ask for a number beyond the end and the last frame is shown instead.

Can I download every frame at once?

Not here — one frame at a time, by number. A batch export would need a ZIP container, which is a different tool from a single-file downloader.

Does this work on a static GIF?

Yes. A non-animated GIF is simply a GIF with one frame, so asking for frame 1 gives you a clean, lossless PNG conversion of it, complete with any transparency the original palette declared.

Why does the frame delay read 0 ms?

Because the GIF declares no delay for that frame. Browsers substitute about 100 ms in that case, which is what the total duration here assumes too.

See also: all Images tools, Audio, Video & Screen, PDF, SVG, Simulations & Screensavers, Generative Art, Chart Makers, 3D Model Viewers, Drawing Pads, Mockups & 3D Making, Diagram Makers, 3D Science, Tracker Music.

Related tools