https://github.com/yazmeyaa/telegram_sticker_converter
Converter for Telegram stickers and animations into various formats.
https://github.com/yazmeyaa/telegram_sticker_converter
animation converter ffmpeg gif go golang graphics library lottie mp4 multimedia tgs webm webp
Last synced: about 2 months ago
JSON representation
Converter for Telegram stickers and animations into various formats.
- Host: GitHub
- URL: https://github.com/yazmeyaa/telegram_sticker_converter
- Owner: yazmeyaa
- License: gpl-3.0
- Created: 2025-09-05T19:15:49.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2025-09-14T19:41:18.000Z (10 months ago)
- Last Synced: 2025-09-14T21:30:38.451Z (10 months ago)
- Topics: animation, converter, ffmpeg, gif, go, golang, graphics, library, lottie, mp4, multimedia, tgs, webm, webp
- Language: Go
- Homepage:
- Size: 41 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Telegram Sticker Converter
Converter for Telegram stickers and animations into various formats.\
Supports **TGS**, **WEBP**, **WEBM**, with the ability to extract single
frames, frame sequences, or convert to video.
## Features
- Support for main Telegram sticker formats: `TGS`, `WEBP`, `WEBM`
- Conversion to static images, animations, and videos
- Flexible frame extraction: first, single, range, or all frames
- Resizing on transformation
- Easy to use as a Go library
## Requirements
- **Go** ≥ 1.24\
- **ffmpeg** ≥ 7.1.1 (for video/animations)
## Supported conversions
| Input | Output |
| -------- | ------------------------------------------------------------------------------------------------------------ |
| **TGS** | PNG (first, all, N-th, range)
JPEG (same)
WEBP (same)
Lottie JSON
GIF
WEBM
MP4 |
| **WEBP** | PNG
JPEG |
| **WEBM** | MP4
GIF
PNG (first, all, N-th, range)
JPEG (same)
WEBP (same) |
## Installation
``` bash
go get github.com/yazmeyaa/telegram_sticker_converter
```
## Usage examples
> General pattern: open input file, create output file, pass
> `TransformOptions`.
### Extract frame from TGS
``` go
conv := tgs.NewConverter()
r, _ := os.Open("./sticker.tgs")
defer r.Close()
w, _ := os.Create("./sticker.png")
defer w.Close()
opts := converter.TGSTransformOptions{
Format: converter.FormatPNG,
Frame: converter.FrameN,
FrameIndex: 10,
ResizeWidth: 1024,
ResizeHeight: 1024,
}
_ = conv.Transform(context.Background(), r, w, opts)
```
### Convert TGS → MP4
``` go
opts := converter.TGSTransformOptions{
Format: converter.FormatMP4,
ResizeWidth: 1024,
ResizeHeight: 1024,
}
_ = conv.Transform(ctx, r, w, opts)
```
### Convert TGS → ZIP with frames
``` go
opts := converter.TGSTransformOptions{
Format: converter.FormatPNG,
Frame: converter.FrameAll,
ResizeWidth: 1024,
ResizeHeight: 1024,
}
_ = conv.Transform(ctx, r, w, opts)
```
## License
GPLv3