Skip to content

Extract GIF frames to PNG images and ZIP

Split animated GIFs into crisp, full-canvas PNG frames with frame delay inspection and one-click ZIP export locally in your browser.

Your files are open only in this tab. Nothing is uploaded.

Animated GIF input

Applies GIF87a/GIF89a disposal compositing to extract crisp full-canvas PNG frames locally.

Drop a GIF file here

Runs offline without uploading animations.

How to use Extract GIF frames

  1. Load an animated GIF. Drop any GIF87a or GIF89a image onto Drop a GIF file here, or click Load sample GIF to inspect the built-in 48x48 spinner animation.
  2. Inspect dimensions and frame timing. Review logical pixel size, total duration, loop count, and individual millisecond delays displayed on each frame card.
  3. Pick the frames you need. Leave all frames checked, click Every 2nd frame to thin dense animations, or toggle individual Frame checkboxes.
  4. Export single PNGs or a batch archive. Click Save PNG on any individual frame card, or click Download selected ZIP to bundle chosen frames locally.

Your files are processed on this device and never uploaded. They stay private, and there's nothing to delete afterwards.

Decoding LZW streams, interlaced passes, and color tables

Using a local GIF frame extractor to split animations into still images inside browser memory keeps product demos, confidential screen recordings, and custom game sprites off remote conversion servers. Running a pure TypeScript decoder inside image.worker.ts outputs exact full-canvas frames with zero external uploads.

Parsing GIF87a and GIF89a headers inside image.worker.ts

Upon dropping an image or clicking Load sample GIF, the worker verifies the six-byte GIF87a or GIF89a signature and reads little-endian logical width and height. Next, it walks through extension blocks (0x21) for NETSCAPE2.0 or ANIMEXTS1.0 loop counters alongside Graphic Control Extensions (0xF9) before reading each 0x2C image block.

Per the W3C GIF89a Specification, compressed pixel indices arrive inside sub-blocks up to 255 bytes using LZW codes (4,096-entry dictionary). When an image flags interlacing, our decoder reconstructs rows across four passes. Users sorting stickers alongside still WebP exports can also decode WebP graphics into lossless PNGs offline.

Handling Global Color Tables, local palettes, and limits

After reading the Logical Screen Descriptor, the parser loads any 2 to 256 color Global Color Table while checking for frame-specific Local Color Tables. Using each frame’s own local palette prevents hue shifts in multi-palette animations converted from video clips.

To keep browser tabs responsive against malformed inputs, extractGifFrames caps logical canvas dimensions at 4,096 × 4,096 (16,777,216 pixels) and 600 frames maximum. Clicking Load sample GIF generates a deterministic 48 × 48 px four-frame sample-spinner.gif using an 8-color palette and 120 ms delays.

Why do raw sub-frames break without disposal compositing?

Many animated GIFs optimize file size by storing only tiny changed rectangles (fx, fy, fw, fh) and masking unchanged pixels as transparent. Reading those sub-blocks in isolation without tracking GIF89a disposal states across a persistent logical canvas produces partial fragments instead of complete video frames.

Restoring canvas state across disposal methods 0 through 3

As summarized in the Library of Congress GIF89a Format Description, GIF encoders rely on incremental frame updates rather than storing full bitmaps every tick. After compositing each frame, the decoder evaluates bits 2–4 of the Graphic Control Extension packed byte to prepare the canvas for the next frame.

When disposal equals 2, the worker clears the just-drawn rectangle back to either the background palette entry or full transparent alpha if transparency appeared earlier. When disposal equals 3, it copies back a prevBackup canvas snapshot saved immediately before decoding that frame. Designers converting extracted sprites into retro tilesets can feed individual PNG frames straight into our Pixel Art Converter.

Preserving alpha transparency from Graphic Control Extensions

Before drawing frame 1, the logical canvas initializes with alpha 0 so transparent pixels inside the opening Graphic Control Extension remain transparent. During pixel painting, any colorIdx matching the frame’s transparentIndex skips overwriting the underlying Uint8ClampedArray pixel.

Each completed canvas snapshot then encodes directly to 32-bit RGBA PNG (colorType = 6) via encodePngRgba without touching an HTML <canvas> element. Bypassing <canvas> color-management prevents browser-specific gamma adjustments or premultiplied-alpha edge halos around thin outlines.

GIF89a disposal methods, delays, and selection controls

Inspecting how Graphic Control Extension fields interact with our Uint8ClampedArray canvas makes debugging flickering sprites or uneven playback timing straightforward. Exported layers match the lossless 8-bit RGBA pixel model defined in the W3C PNG Third Edition Specification.

GIF89a field or UI control Byte / default value Canvas or UI behavior Common animation usage
Disposal method 0 / 1 Leave graphic in place Keeps pixels visible for next sub-frame Delta overlays and moving sprites over static scenes
Disposal method 2 Restore background Clears frame bounds to background or transparent Spinning icons and transparent stickers without trails
Disposal method 3 Restore previous Reverts canvas to pre-frame prevBackup snapshot Blinking eyes or temporary badges over rich art
Graphic Control delay delayCs * 10 ms (100 ms fallback) Sets per-card delay badge and @timestamp ms Inspecting variable cadence or frame holds
Every 2nd frame Even-index filter Checks frames 1, 3, 5... (idx % 2 === 0) Halving 50 fps captures to lightweight keyframes

When a single GIF already packs a multi-panel collage or grid layout that needs slicing into separate tiles afterward, hand the saved PNG off to sprite grid and carousel slicing. Summary pills above the grid show exact selected counts (X of N selected) alongside total duration and loop count.

Tip: Click Load sample GIF and inspect frame timestamps (@0 ms, @120 ms, @240 ms, @360 ms) to see how disposal 2 clears each moving colored quadrant cleanly between 120 ms ticks.

Exporting single PNG frames and store-mode ZIP archives

Once your frame cards finish rendering, a checkerboard background makes transparent pixels immediately visible beside exact PNG byte sizes. Downloading outputs straight from browser RAM avoids server queues, watermarks, or file expiration links.

Picking keyframes with Every 2nd frame and Save PNG

Clicking Save PNG on any frame card exports that single full-canvas image immediately as <stem>-frame-0001.png using four-digit zero-padding. For multi-frame exports, Select all, Every 2nd frame, and Clear selection toggle checkboxes in bulk before clicking Download selected ZIP.

Inside zipSelectedGifFrames, filenames zero-pad dynamically (-frame-001.png or wider for 1,000+ frames) to preserve chronological sorting across macOS Finder, Windows Explorer, and Linux shells. Following the PKWARE ZIP File Format Specification, PNG archives bundle under Store compression (level: 0) because PNG streams are already Deflate-compressed, keeping archive creation snappy.

Assembling sprite sheets and pixel-art assets offline

Game developers and UI motion engineers frequently unpack animated GIF sprites into crisp PNG frames to inspect individual timing holds or edit single pixels cleanly. Removing redundant in-between frames with Every 2nd frame also shrinks sprite sheet footprints before bundling assets for CSS animations.

After selecting and downloading your keyframe PNGs, you can join extracted keyframes into vertical sprite strips offline without touching desktop editors. Every allocated blob URL revokes automatically when loading a new GIF or closing the tab.

Questions

Why do raw GIF sub-frames look broken in basic frame splitters?

Optimized GIF encoders shrink files by writing only small changed bounding boxes on top of earlier frames. Without applying GIF89a disposal rules 0 through 3 onto a persistent logical canvas, extracted frames show floating eyes, detached fragments, or missing backgrounds.

Are transparent GIF backgrounds preserved in exported PNG frames?

Yes. Every decoded frame composites onto a 32-bit RGBA buffer that respects the Graphic Control Extension transparent color index. Exported PNG files keep crisp transparent margins ready for editors, slides, and sprite tools.

Can I export every second frame or pick specific frames for ZIP download?

Yes. Click Every 2nd frame to halve the selection automatically, or use Select all, Clear selection, and individual frame checkboxes before clicking Download selected ZIP. Single-frame Save PNG buttons also work regardless of checkbox state.

How many frames and what canvas dimensions can the browser decode safely?

The decoder safely caps logical canvas dimensions at 4,096 by 4,096 pixels (16,777,216 total pixels) and processes up to 600 frames per file. Those bounds protect desktop and mobile browser tabs against out-of-memory crashes on malformed files.

How are GIF frame delays and loop counts read from animated files?

Each Graphic Control Extension stores frame delay in hundredths of a second, which the parser multiplies by 10 to display millisecond durations and cumulative timestamps. Application extension blocks labeled NETSCAPE2.0 or ANIMEXTS1.0 supply the animation loop counter.

Do exported PNG frames retain the original animation palette without blur?

Yes. Every indexed GIF pixel maps directly from its active Global or Local Color Table into uncompressed 8-bit RGB channels inside a 32-bit RGBA PNG without bilinear smoothing or JPEG recompression.

Updated