GIF Splitter
Split an animated GIF into frames: GIF to PNG or JPG, ZIP download, sprite sheet with JSON coordinates. Correct frame compositing, runs in your browser.
- Runs in your browser
- Tool input is not uploaded to ZeroTool servers
- Free · No Sign-Up
Scan with WeChat to share this tool
Examples, details and FAQ Worked examples, how it compares with other tools, and answers to common questions.
Full Frames, the Way the Browser Shows Them
A GIF does not store a stack of complete pictures. After the first frame, encoders usually write only the rectangle that changed and mark unchanged pixels as transparent. Each frame also carries a disposal method:
| Disposal | Meaning | What the next frame starts from |
|---|---|---|
| 0 / 1 | Leave in place | This frame stays on the canvas |
| 2 | Restore to background | This frame's rectangle is cleared to transparent |
| 3 | Restore to previous | The canvas goes back to how it was before this frame |
Exporting the raw patches gives you fragments with holes in them. The splitter keeps a running canvas, applies each disposal rule in order, and saves a copy of the canvas after every frame. Each exported PNG is the complete picture at that moment. Frames also keep their full canvas size, so frame 12 lines up with frame 1 pixel for pixel.
Example: What a Five-Frame GIF Stores
A 64 × 64 GIF with a blue bar moving right, saved by Pillow 12.1.1 with frame durations of 100, 200, 50, 500 and 0 ms and a loop count of 2. The splitter's parser reads it as:
#1 rect 64x64@0,0 disposal 1 delay 10cs -> 100 ms
#2 rect 26x16@8,24 disposal 1 delay 20cs -> 200 ms
#3 rect 26x16@18,24 disposal 1 delay 5cs -> 50 ms
#4 rect 26x16@28,24 disposal 1 delay 50cs -> 500 ms
#5 rect 26x16@38,24 disposal 1 delay 0cs -> 100 ms
- Only frame 1 covers the canvas. Frames 2–5 are 26 × 16 patches. Saved one by one, they would be four small strips; the splitter exports five complete 64 × 64 frames.
- Frame 5 says 0 cs. Chromium, Firefox and WebKit play delays of 0 or 1 cs at 100 ms, so the thumbnail and the JSON show 100 ms. ffmpeg and Pillow report the raw value; a script that trusts them plays that frame much faster than any browser does.
- The info bar shows "repeats after first play: 2": the NETSCAPE2.0 count means repeats, so the animation plays three times in total.
- Frame 3 downloads as
spinner-frame-003.png. With 5 columns and no spacing, the sprite sheet is 320 × 64 and the JSON durations are 100, 200, 50, 500 and 100.
Sprite Sheets and the JSON Data
The sprite sheet places the selected frames in a grid, left to right and top to bottom, with optional spacing between cells. Spacing stays transparent. The JSON looks like this:
{
"image": "loader-sprite.png",
"width": 256,
"height": 64,
"frameWidth": 64,
"frameHeight": 64,
"columns": 4,
"spacing": 0,
"frames": [
{ "frame": 1, "x": 0, "y": 0, "w": 64, "h": 64, "duration": 80 },
{ "frame": 2, "x": 64, "y": 0, "w": 64, "h": 64, "duration": 80 }
]
}
frame is the original frame number, so gaps show which frames you skipped. duration is in milliseconds.
For a pure-CSS animation, set Columns to the number of selected frames to get a single row, then step through it:
.loader {
width: 64px;
height: 64px;
background: url(loader-sprite.png) 0 0 / auto 64px;
animation: play 0.32s steps(4) infinite;
}
@keyframes play {
to { background-position: -256px 0; }
}
Common Use Cases
- Grab one still from a reaction GIF or screen recording as a lossless PNG for a slide, a bug report or a thumbnail.
- Turn a GIF into a game sprite sheet for Phaser, PixiJS, Godot or a hand-written canvas loop, with frame timing kept in the JSON.
- Replace a heavy GIF with CSS
steps()animation, or with a few selected frames re-encoded as WebP. - Review a UI animation frame by frame to find the exact frame where a layout jumps or a transition glitches.
- Pull every Nth frame from a long GIF to build a storyboard or a contact sheet.
Why Not Just Use ffmpeg?
ffmpeg is the right tool for very large files, and it composites frames correctly. One catch: with default settings it resamples variable-delay GIFs to a constant frame rate. For the five-frame GIF above, ffmpeg 9.0.2 wrote 19 PNGs. Add -fps_mode passthrough (FFmpeg 5.1 and later; older builds use -vsync passthrough) to get exactly one image per frame — 5 for that file:
ffmpeg -i input.gif -fps_mode passthrough frame-%03d.png
This page gives you the same frames with no install, lets you pick frames visually, and builds the sprite sheet and JSON in one step.
How It Works
The page decodes the GIF itself instead of relying on the browser's image decoder, because the WebCodecs ImageDecoder is not available in every browser and does not expose each frame's disposal method. The decoder reads the logical screen descriptor, the global and local color tables, the Graphic Control Extension (delay, disposal, transparent color) and the NETSCAPE2.0 loop count. It then decompresses each frame's LZW data: variable-width codes that grow from the minimum code size up to 12 bits, with clear codes that reset the dictionary. Interlaced frames are rebuilt from their four row passes. A file that ends early still yields every pixel decoded up to the break. Decoding runs in short slices, so the page stays responsive and shows progress on large files.
Limits
- Frames always export at the full canvas size. Cropping and resizing are out of scope; the Image Compressor can resize exported frames.
- Output formats are PNG, JPG, a ZIP of either, and a PNG sprite sheet. To convert frames to WebP, use the WebP Converter.
- Editing or re-assembling an animated GIF is out of scope. This tool only takes GIFs apart.
- Size limits: 50 million decoded pixels, 1,000 frames, and 16,777,216 pixels per frame or sprite sheet. A 1920 × 1080 screen recording with 60 frames is 124,416,000 decoded pixels and is refused before decoding; the page shows the ffmpeg command instead. The 16,777,216-pixel cap comes from Mobile Safari, where the canvas-size project measured 4,096 × 4,096 as the largest usable canvas.
- The ZIP is often much larger than the GIF: each exported frame covers the full canvas, while the GIF may store only small patches. Export fewer frames with the step selector, or convert them with the WebP Converter.
- A damaged file still opens. If the data ends inside a frame, every pixel decoded before the break is kept and the status line says the file ends early.
Related Tools
- WebP Converter — convert exported PNG frames to WebP in bulk.
- Pixelate Image — blur or black out details in a frame before you share it.
- Image Compressor — shrink or resize exported frames and sprite sheets.
FAQ
Do I get full frames or only the part that changed?
Full frames. Most GIFs store each frame as a small patch plus a disposal rule that says what to do with it before the next frame. The splitter applies all four disposal methods and exports every frame exactly as your browser shows it during playback. Raw patch output is not offered, by design. If you need the stored patches, run gifsicle --explode locally.
Is my GIF uploaded anywhere?
No. The file is read with the File API and decoded by JavaScript on this page. PNG and JPG encoding, ZIP packing and the sprite sheet all happen in your browser. Only your export settings (format, JPG quality, background color, columns, spacing) are saved, in this browser's local storage; Ctrl/⌘+L keeps them, and clearing this site's data in the browser removes them. The GIF and its frames are not saved. The page loads Google Analytics and AdSense like other tool pages. Its usage events hold only the tool name and the action: decode when a GIF finishes decoding, frame when you download one frame, zip when you download a ZIP, and sprite when a sprite sheet is built.
How large a GIF can it handle?
Up to 50 million decoded pixels (width × height × frames), 1,000 frames, and 16,777,216 pixels per frame or sprite sheet (16,384 px max per side). Frames are kept uncompressed in memory, so these limits keep the page within phone memory. A 480×270 GIF with 385 frames still fits. For larger files, run ffmpeg -i input.gif -fps_mode passthrough frame-%03d.png locally.
Why does a frame show 100 ms when the file says 0?
Major browsers play any frame delay of 10 ms or less (0 or 1 in the GIF's centisecond units) at 100 ms. The splitter shows and exports that real playback time, so the sprite sheet JSON matches what people see in a browser. Delays of 20 ms and above are kept as written.
What is in the sprite sheet JSON?
The image name, the sheet width and height, the frame size, the column count and spacing, and one entry per frame with its original frame number, x, y, w, h and duration in milliseconds. You can feed it to a game engine, a canvas animation loop, or CSS keyframes.