AVIF to GIF Converter
Convert AVIF images to GIF format online. Free batch AVIF to GIF converter with color quantization, dithering, and instant download.
Drop AVIF files here or browse
Up to 20 files, max 50 MB each
About
AVIF uses AV1 intra-frame coding with 10-bit or 12-bit color depth and supports millions of colors per pixel. GIF is constrained to a maximum of 256 indexed colors per frame with 1-bit transparency. Converting between these formats requires lossy color quantization: every pixel in the source must be mapped to the nearest entry in a reduced palette. Without proper dithering, this mapping produces visible banding artifacts in smooth gradients. This tool applies Median Cut quantization to build an optimal 256-color palette, then uses Floyd-Steinberg error diffusion to distribute quantization error across neighboring pixels. The result is a GIF file that preserves perceptual detail far better than naive nearest-color mapping.
Note: GIF is a legacy format. It does not support semi-transparency (alpha is binary on/off), cannot represent HDR content, and produces large files for photographic content. This tool approximates the source image assuming an sRGB color space and 8-bit output depth. Files above 4000 × 4000 pixels may require significant processing time due to the O(n log n) cost of palette generation across millions of pixels.
Formulas
The conversion pipeline applies two core algorithms sequentially. First, Median Cut quantization reduces the full RGB color space to 256 representative colors. Then LZW compression encodes the indexed pixel stream into the GIF binary format.
Color distance in RGB space (Euclidean):
d = √(r1 − r2)2 + (g1 − g2)2 + (b1 − b2)2Floyd-Steinberg error diffusion distributes quantization error e to neighboring pixels:
e = original − quantizedpixel(x+1, y) += e × 716
pixel(x−1, y+1) += e × 316
pixel(x, y+1) += e × 516
pixel(x+1, y+1) += e × 116
LZW minimum code size for GIF starts at 8 bits (matching 256-color palette). The initial dictionary has 258 entries: 256 color indices + Clear Code (256) + EOI Code (257). Code width grows from 9 to 12 bits as the dictionary fills.
Where r, g, b are the red, green, blue channel values in range [0, 255]. e is the per-channel error vector. The diffusion kernel coefficients sum to 1 (7+3+5+116 = 1), ensuring no energy is created or destroyed during diffusion.
Reference Data
| Property | AVIF | GIF |
|---|---|---|
| Year Introduced | 2019 | 1987 (GIF89a: 1989) |
| Compression | AV1 Intra-frame (lossy/lossless) | LZW (lossless on indexed data) |
| Max Colors | 16.7M+ (up to 12-bit depth) | 256 per frame (indexed palette) |
| Bit Depth | 8/10/12 bits per channel | 8 bits per pixel (indexed) |
| Transparency | Full 8-bit alpha channel | 1-bit (on/off per pixel) |
| Animation | Supported (AVIF sequence) | Supported (frame-based) |
| HDR Support | Yes (PQ, HLG transfer functions) | No |
| Color Space | sRGB, Display P3, BT.2020 | sRGB only (implicit) |
| Typical Compression Ratio (Photo) | 20:1 - 50:1 | 3:1 - 5:1 |
| Lossless Mode | Yes | Yes (within 256-color limit) |
| MIME Type | image/avif | image/gif |
| File Signature (Magic Bytes) | ftypavif at offset 4 | GIF87a or GIF89a |
| Max Dimensions | 65536 × 65536 | 65535 × 65535 |
| Browser Support (2024) | Chrome, Firefox, Safari 16.4+, Edge | Universal (all browsers) |
| ICC Profile | Embedded (NCLX / ICC) | Not supported |
| Metadata | EXIF, XMP via ISOBMFF | Comment extension only |
| Interlacing | Not applicable | Supported (4-pass) |
| Use Case | Web photos, HDR content | Simple graphics, logos, memes |
| Licensing | Royalty-free (AOM) | Patent-free (since 2004) |