TGS is the file format behind Telegram’s animated stickers. Technically it’s simple: take a Lottie animation (the JSON format exported from After Effects by Bodymovin), compress it with gzip, add a "tgs": 1 marker, and rename it to .tgs. Telegram renders it with rlottie, a fast native Lottie player.
The hard limits
| Property | Sticker | Custom emoji |
|---|---|---|
| Canvas | exactly 512 × 512 | exactly 100 × 100 |
| File size (gzipped) | ≤ 64 KB | ≤ 64 KB |
| Duration | ≤ 3 seconds | ≤ 3 seconds |
| Frame rate | 30 or 60 FPS | |
| Looping | plays in a loop automatically | |
On top of the numeric limits, rlottie supports a subset of Lottie: no expressions, no raster images, no text layers, no 3D. Vector shape layers with fills, strokes, gradients, trim paths, and masks are all safe — which is exactly the subset an SVG converts into.
Why Telegram chose vectors
A typical animated TGS is 10–40 KB — smaller than a single frame of an equivalent GIF. It stays razor sharp on any screen density, animates at a full 60 FPS, and decodes fast enough for a chat full of stickers to play simultaneously on a mid-range phone.
Creating a TGS file
The official route is After Effects + Bodymovin with Telegram’s export preset. The fast route, if your art is vector already: convert an SVG directly with svgtgs — it builds the Lottie shape layers, applies your chosen animation preset, validates every limit above, and gzips the result. See how to convert SVG to TGS.