Skip to main content

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.

Convert to GIF — Interactive Browser WorkspaceAssemble 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.
100% Client-Side • Zero Server Upload
Sample Input / Parameters

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
Instant In-Browser Capabilities
  • ✓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
100% Client-Side • Zero Server Upload

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 (2N+12^{N+1} entries) and color depth.
  • NETSCAPE2.0 Looping Extension (0x21 0xFF): Writes the 11-byte application identifier NETSCAPE2.0 plus a 16-bit repeat counter where 0 signals 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 + 1 bits and expanding dynamically up to 12 bits (4096 codes). Whenever the dictionary fills, the encoder emits a CLEAR code to reset the table, packs bits LSB-first into 254-byte data sub-blocks, and closes the file with the 0x3B GIF 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 PresetPalette SizeIndex Bit DepthLZW Compression EfficiencyVisual Characteristics & Best Fit
Low32 colors5-bit indicesHighest (smallest file size)Visible banding on photographic gradients; ideal for flat icons, pixel art, and tiny <256 KB Slack/Discord emojis.
Medium64 colors6-bit indicesHighBalanced weight-to-clarity ratio; well suited for UI screen captures, terminal demos, and docs callouts.
High128 colors7-bit indicesModerateSmooth skin tones and brand gradients without bloated payloads; strong default for social clips and banners.
Max256 colors8-bit indicesLowest (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:

  1. Match aspect ratios before upload: The compiler anchors output dimensions to the first frame (capping the longest edge at 800px to protect browser memory). Feeding uniformly cropped source images avoids unintentional stretching.
  2. Lower FPS instead of dropping clarity: Humans perceive UI walkthroughs clearly at 5–10 FPS (100ms–200ms delay). Doubling a frame's delay cuts total frame count—and file size—nearly in half without hurting sharpness.
  3. 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

1

Upload one or more PNG, JPG, WebP, BMP, AVIF, or HEIC images via drag-and-drop, file browser, or direct clipboard paste.

2

Arrange your frame sequence on the timeline—reorder frames left or right, duplicate key frames for dramatic holds, or delete unwanted shots.

3

Customize global frame delay (ms), loop count (0 for infinite looping), disposal method, and target palette size (32 to 256 colors).

4

Select any individual frame to tweak its delay, 90° rotation, horizontal/vertical flip, top/bottom Impact caption, or subtle corner watermark.

5

Preview the live animation loop at adjustable playback speed and optionally apply a social preset such as Discord Emoji (128x128) or Twitter/X (1200x675).

6

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?
The GIF89a specification stores pixels as 8-bit palette indices rather than full 24-bit RGB triplets, which strictly limits each Global or Local Color Table to 2^8 = 256 entries. Our client-side quantizer clusters 24-bit canvas frames into optimized per-frame palettes (32, 64, 128, or 256 colors) to preserve detail while maximizing LZW compression.
Why does my animated GIF play slower in browsers when I set frame delay below 20ms?
GIF89a stores frame durations as 16-bit integers in hundredths of a second (centiseconds), so 20ms equals 2 centiseconds. Legacy compatibility rules in Chrome, Firefox, and Safari clamp delays of 0 or 1 centisecond (under 20ms) up to 100ms (10 FPS). Use 30ms–100ms per frame for reliable high-frame-rate playback.
What is the difference between GIF disposal methods 1, 2, and 3?
Disposal method 1 (Do Not Dispose) leaves the previous frame intact underneath the next frame, which is useful for additive overlays. Method 2 (Restore to Background) clears the canvas before painting the next frame to prevent trailing ghosts on transparent sprites. Method 3 (Restore to Previous) reverts to the state prior to rendering the current frame.
Can I convert Apple HEIC photos directly into a GIF without installing extra codecs?
Yes. When you drop .heic files onto the timeline, the tool dynamically loads a client-side HEIC decoder in your browser, rasterizes each frame to PNG pixel data locally, and feeds it straight into the GIF89a encoder with zero server uploads.
Why are very large input photos automatically scaled during GIF compilation?
Uncompressed RGBA buffers for multi-frame 4K timelines quickly consume hundreds of megabytes of browser heap memory and produce massive LZW streams that fail chat upload limits. During compilation, dimensions exceeding 800px on the longest edge are proportionally downscaled to keep encoding responsive and output file sizes practical.

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

Explore More Tools in This Category

View All Developer & Utility Tools