Зачем конвертировать TGS в LOTTIE?
Sticker creators want the editable Lottie source to tweak the animation in tools such as LottieFiles or re-export it for a non-Telegram platform. Developers building other apps need the raw Lottie JSON so their Lottie player can load it directly.
Способы конвертации TGS в LOTTIE
7-Zip OPEN-SOURCE
Rename sticker.tgs to sticker.tgs.gz, right-click and choose 7-Zip > Extract here, then rename the output to sticker.lottie.
gunzip FREE
Run cp sticker.tgs sticker.json.gz && gunzip sticker.json.gz in a terminal; rename the result to .lottie if the target tool requires that extension.
python-lottie OPEN-SOURCE
Install with pip install lottie and run lottie_convert.py sticker.tgs sticker.json; rename to .lottie for tools that require that extension.
Об этих форматах
Файл TGS - это анимированный стикер Telegram, представляющий собой векторную Lottie-анимацию, сжатую с помощью gzip (обычно 20-30 КБ). Настольные приложения не открывают его двойным…
Открыть детали .TGS →Файл .LOTTIE - это файл данных, используемый специальным программным обеспечением.
Открыть детали .LOTTIE →Качество и на что обратить внимание
- No quality loss occurs - this is lossless decompression; every vector shape, keyframe, and layer is preserved exactly.
- The only structural difference between a
.tgsand a plain Lottie JSON is the gzip wrapper; the GZIP magic bytes at offset 0 mark the compression. - Telegram's constraints (512x512 canvas, frame rate, duration) are reflected in the JSON fields
w,h,fr, andopand remain in the file after decompression.
Часто задаваемые вопросы
Is there a difference between a .lottie file and the JSON extracted from a .tgs?
.lottie extension is used by some modern tools and may imply a dotLottie package format; if a tool expects plain JSON, use the .json extension instead.Can I re-upload the extracted Lottie JSON as a Telegram sticker?
.tgs (gzip the JSON) before uploading.