Convert a Lottie animation to an animated PNG. Unlike GIF, an APNG keeps full truecolour and a real 8-bit alpha channel, so gradients do not band into visible steps and soft edges do not fringe against the background — GIF has exactly one bit of transparency, which is why its edges always look cut out. The timing is computed so the rounding adds up rather than drifting slower every loop. And because an APNG is a valid PNG file, anything too old to read the animation shows the first frame instead of a broken image. Everything renders in your browser and nothing is uploaded.
| APNG | GIF | WebM | |
|---|---|---|---|
| Colours | Full truecolour | 256 | Full truecolour |
| Transparency | 8-bit alpha | 1 bit, fringes | Alpha in VP9 |
| File size | Large | Medium | Small |
| Needs a player | No | No | Video element |
| If unsupported | Shows first frame | Broken image | Nothing plays |
Two reasons, both visible. GIF stores one bit of transparency, so every pixel is either fully opaque or fully clear and soft edges fringe against whatever is behind them. And GIF is limited to 256 colours, so gradients band into visible steps. APNG has a full alpha channel and full truecolour, so neither happens.
Because it needs no player, no autoplay permission and no muting, and it keeps transparency — which almost no video format does in a browser. The trade is file size: an APNG is much larger than an equivalent video.
It reduces the image to 256 colours, which shrinks the file substantially. It also gives up much of what makes APNG worth choosing, so it is best used for flat-colour animations where there is no gradient to band in the first place.
Every current browser plays APNG. Older software that does not understand the animation chunks shows the first frame, because an APNG is a valid PNG — so the worst case is a still image, not a broken one.
Below about sixteen pixels the encoder's frame-differencing breaks down and writes a file that claims more frames than it actually contains, which some decoders render as a single still. No real animation is that small, but the size control can reach it, so it is blocked.
APNG compresses each frame losslessly, so it is far larger than a video of the same animation. Fewer frames per second, a smaller output size, or the quantise option all help — and if you do not need transparency, a WebM or MP4 will be a fraction of the size.
No. It is rendered and encoded entirely in your browser.
Frames are rendered one at a time through lottie-web's canvas renderer with `goToAndStop` rather than captured during playback, so a busy tab cannot drop a frame out of the result, and each frame's RGBA bytes are copied off the canvas before being handed to the encoder. APNG is then written with full truecolour and an 8-bit alpha channel, which is the entire reason to prefer it to GIF: GIF stores a single bit of transparency, so every pixel is either wholly opaque or wholly clear and soft edges fringe against whatever sits behind them, and its 256-colour palette bands any gradient. A quantised mode is offered for when size matters more, and it is described honestly as giving up exactly that advantage. Per-frame delays are computed so the rounding adds up: at 30 fps a flat 33 milliseconds per frame loses ten milliseconds every second, which accumulates into a loop that visibly drifts slower than the source, so the remainder is distributed across frames and the total duration comes out exact. There is a minimum output size, because below roughly sixteen pixels the encoder's inter-frame differencing collapses and emits a file whose animation-control chunk claims several frames while the file carries only one frame-control chunk and no frame data at all — malformed, and shown by some decoders as a still image. The render is also checked for coverage when transparency is on: if no frame contains a single opaque pixel then the renderer drew nothing, and the export stops with an explanation instead of producing an animation of empty frames. The practical advantage of the format is that an APNG is a valid PNG, so anything that cannot read the animation chunks shows the first frame rather than a broken image.