Convert to GIF
Assemble animated or static GIF89a files from PNG, JPG, WebP, BMP, AVIF, and HEIC images entirely in your browser with frame timing, color quantization, captions, and ZIP export.
Assemble animated or static GIF89a files from PNG, JPG, WebP, BMP, AVIF, and HEIC images entirely in your browser with frame timing, color quantization, captions, and ZIP export.
Ready locally via WebAssembly & JavaScript- ✓Pure client-side GIF89a binary encoder implementing 12-bit variable-length LZW compression and NETSCAPE2.0 looping
- ✓Per-frame RGB565 color quantization across four palette tiers (32, 64, 128, and 256 colors) with 1-bit alpha transparency
- ✓Multi-format frame ingestion supporting PNG, JPG, JPEG, WebP, BMP, AVIF, existing GIF, and dynamically decoded Apple HEIC
Even decades after CompuServe published the GIF89a specification in 1989, the Graphics Interchange Format remains the universal lowest-common-denominator format for looping animations across Slack, Discord, GitHub pull requests, email newsletters, and legacy CMS platforms. Because GIF does not require a <video> tag or hardware media decoder, any <img> element renders it automatically. This Convert to GIF studio builds spec-compliant static and animated GIF89a bitstreams directly inside your browser using a self-contained TypeScript color quantizer and LZW encoder—meaning your screenshots, product prototypes, and burst photos are never uploaded to third-party processing queues.
GIF89a Binary Structure and LZW Compression Mechanics
When you compile a timeline, the encoder assembles a raw Uint8Array byte stream conforming strictly to the GIF89a wire layout rather than relying on server-side ffmpeg wrappers:
- Header & Logical Screen Descriptor: Opens with the 6-byte ASCII signature
GIF89a, followed by canvas width/height (little-endian 16-bit integers) and a packed bitfield specifying the Global Color Table size exponent ( entries) and color depth. - NETSCAPE2.0 Looping Extension (
0x21 0xFF): Writes the 11-byte application identifierNETSCAPE2.0plus a 16-bit repeat counter where0signals infinite looping across all compliant renderers. - Graphic Control Extension (
0x21 0xF9): Precedes every frame with its packed disposal flags (0–3), 1-bit transparency toggle, and frame duration encoded in hundredths of a second (Math.round(delayMs / 10)). - Local Color Tables & Image Descriptor (
0x2C): Subsequent frames receive dedicated Local Color Tables tailored to each frame's chromatic distribution, preventing severe color drift across multi-scene animations. - 12-Bit Variable-Length LZW Stream: Compresses the 8-bit indexed pixel array using a hash-indexed Lempel-Ziv-Welch dictionary starting at
minCodeSize + 1bits and expanding dynamically up to 12 bits (4096codes). Whenever the dictionary fills, the encoder emits aCLEARcode to reset the table, packs bits LSB-first into254-byte data sub-blocks, and closes the file with the0x3BGIF trailer byte.
Color Palette Quantization and Bit-Depth Trade-Offs
Full-color canvas frames contain 24-bit RGB channels (16.7 million possible colors), which must be mapped into at most 256 indexed palette slots. The built-in quantizer bins pixels into a 16-bit RGB565 histogram (65,536 buckets) and iteratively merges lowest-error color clusters via a binary min-heap until the target color budget is reached, snapping near-transparent pixels via 1-bit alpha thresholding.
| Quality Preset | Palette Size | Index Bit Depth | LZW Compression Efficiency | Visual Characteristics & Best Fit |
|---|---|---|---|---|
| Low | 32 colors | 5-bit indices | Highest (smallest file size) | Visible banding on photographic gradients; ideal for flat icons, pixel art, and tiny <256 KB Slack/Discord emojis. |
| Medium | 64 colors | 6-bit indices | High | Balanced weight-to-clarity ratio; well suited for UI screen captures, terminal demos, and docs callouts. |
| High | 128 colors | 7-bit indices | Moderate | Smooth skin tones and brand gradients without bloated payloads; strong default for social clips and banners. |
| Max | 256 colors | 8-bit indices | Lowest (largest file size) | Maximum GIF89a fidelity for vibrant photography, cinematic burst sequences, and color-rich product spins. |
Reducing a UI screencast from 256 colors to 64 colors often trims output byte weight by 30%–45% because LZW encounters longer repeated runs of identical palette indices across flat interface panels.
Frame Timing, Disposal Methods, and Browser Delay Clamping
Two subtle GIF89a quirks trip up developers and content creators more than anything else: sub-20ms delay clamping and frame disposal ghosting.
Because the Graphic Control Extension quantizes delay into centiseconds (1/100 s), specifying 10ms writes 1, and 0ms writes 0. To protect CPUs from runaway zero-delay loops authored in the 1990s, Chromium, Firefox, and Safari enforce a hard floor: any frame with a delay below 2 centiseconds (< 20ms) is silently clamped up to 100ms (10 FPS). If you want smooth, brisk motion, set frame delays to 40ms (25 FPS), 50ms (20 FPS), or 60ms (~16.6 FPS) rather than 10ms.
Equally important is the Disposal Method packed into bits 2–4 of the Graphic Control Extension:
- Method 1 (Do Not Dispose): Leaves rendered pixels on canvas so the next frame draws directly over them. Works well for opaque full-bleed photos, but leaves smeared silhouettes behind transparent PNG sprites.
- Method 2 (Restore to Background — Default): Clears the previous frame region before drawing the next image, eliminating ghosting trails on transparent stickers, icons, and cropped animations.
- Method 3 (Restore to Previous): Reverts the canvas to the last non-disposed frame state, rarely needed outside hand-optimized sprite sheets.
Multi-Format Ingestion, Social Presets, and Batch Workflows
The timeline accepts mixed source formats in a single session—combining PNG, JPEG, WebP, BMP, AVIF, existing GIFs, and Apple HEIC photos. When an iPhone .heic asset is detected, the tool dynamically decodes it locally via heic2any before rasterizing it onto the staging canvas; if you prefer standalone static JPEG extraction from Apple photos first, use the dedicated HEIC to JPG Converter.
Every frame supports independent 90° rotation, horizontal/vertical flipping, custom millisecond hold durations, bold stroked Impact top/bottom captions (for quick animated reactions alongside our dedicated Meme Generator), and subtle corner watermarks. Social sizing presets snap frames to standard platform geometries—including 128×128 for Discord and Slack custom emojis, 1080×1080 for Instagram, and 1200×675 for X/Twitter—while the Export ZIP utility packages every edited, captioned frame into numbered PNG files via JSZip for archival or external video editing.
Practical Optimization Tips to Keep Animated GIFs Under Platform Caps
Chat apps and documentation platforms impose strict attachment ceilings (such as 256 KB for Discord/Slack emojis or 10 MB on GitHub issues). Keep these rules of thumb handy before compiling:
- Match aspect ratios before upload: The compiler anchors output dimensions to the first frame (capping the longest edge at
800pxto protect browser memory). Feeding uniformly cropped source images avoids unintentional stretching. - Lower FPS instead of dropping clarity: Humans perceive UI walkthroughs clearly at
5–10 FPS(100ms–200msdelay). Doubling a frame's delay cuts total frame count—and file size—nearly in half without hurting sharpness. - Know when to switch codecs: GIF remains unbeatable for zero-friction embeds, but for high-resolution photographic web animations where transparency and modern browser support are guaranteed, migrating static or animated assets to WebP via the WebP Converter typically yields dramatically smaller files and full 24-bit color depth.
How to Use Convert to GIF
Upload one or more PNG, JPG, WebP, BMP, AVIF, or HEIC images via drag-and-drop, file browser, or direct clipboard paste.
Arrange your frame sequence on the timeline—reorder frames left or right, duplicate key frames for dramatic holds, or delete unwanted shots.
Customize global frame delay (ms), loop count (0 for infinite looping), disposal method, and target palette size (32 to 256 colors).
Select any individual frame to tweak its delay, 90° rotation, horizontal/vertical flip, top/bottom Impact caption, or subtle corner watermark.
Preview the live animation loop at adjustable playback speed and optionally apply a social preset such as Discord Emoji (128x128) or Twitter/X (1200x675).
Click Compile GIF to run in-browser quantization and LZW encoding, then download the finished .gif file or export all edited frames as a ZIP archive.
Frequently Asked Questions
Why can a single GIF frame only contain up to 256 colors?
Why does my animated GIF play slower in browsers when I set frame delay below 20ms?
What is the difference between GIF disposal methods 1, 2, and 3?
Can I convert Apple HEIC photos directly into a GIF without installing extra codecs?
Why are very large input photos automatically scaled during GIF compilation?
Key Features
- Pure client-side GIF89a binary encoder implementing 12-bit variable-length LZW compression and NETSCAPE2.0 looping
- Per-frame RGB565 color quantization across four palette tiers (32, 64, 128, and 256 colors) with 1-bit alpha transparency
- Multi-format frame ingestion supporting PNG, JPG, JPEG, WebP, BMP, AVIF, existing GIF, and dynamically decoded Apple HEIC
- Granular timeline sequencing with per-frame millisecond delays, frame duplication, reordering, rotation, and horizontal/vertical flips
- Built-in Impact meme captions (top and bottom outlined text), corner watermarks, and social dimension presets (Discord, Slack, Instagram, X)
- Real-time canvas playback preview with 0.5x–2x speed controls, localStorage preset profiles, and batch PNG frame export as a ZIP archive
Common Use Cases
- Building looping UI micro-interactions and bug-reproduction clips from sequential PNG or WebP screenshots
- Creating 128x128 custom animated emojis and reaction badges tailored to Discord and Slack file-size limits
- Converting burst iPhone HEIC or JPEG photos into stop-motion product spins and social reaction loops
- Adding top/bottom meme captions and brand watermarks across multi-frame sequences before compiling
- Re-timing, reordering, or reversing individual animation frames and exporting edited frames as a numbered ZIP bundle
- Generating single-frame static GIFs for legacy email clients, forums, or CMS pipelines that restrict modern image formats
Related Tools
Explore More Tools in This Category
View All Developer & Utility ToolsICO to PNG Converter
Extract high-quality PNG images from ICO favicon files. Supports batch processing, transparency preservation, multiple size detection, and Retina upscaling. 100% private and local.
Meme Generator
Create custom memes locally using starter templates, gradient canvases, or your own photos with draggable captions, emoji stickers, canvas filters, and multi-format export.
Compress Image Online
Compress images online with perfect visual quality. Reduce image file size instantly using client-side JPEG, PNG, WebP, and AVIF optimization.
Resize Image Online
Resize images online to custom dimensions or social media presets. Shrink dimensions, crop, fit, convert format, and optimize photos client-side.
Photo Editor
Retouch, crop, annotate, and layer raster images directly inside your browser with real-time HTML5 Canvas compositing, undo/redo history, and multi-format export.
AI Background Remover
Remove image backgrounds automatically in your browser using AI. Create transparent PNGs, replace backgrounds, and export high-quality cutouts instantly.
Scan to PDF
Turn your smartphone rear camera or desktop webcam into a zero-upload document scanner with real-time luminance enhancement, B&W contrast filtering, page rotation, and multi-page PDF compilation.
Crop Image Online
Professionally crop your images online with precision controls, social media presets, and no quality loss. 100% secure client-side processing.