0xNima / tgs2animated

Converts animated Telegram stickers (*.tgs) to animated WEBPs (.webp)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tgs2animated(With Python support)

Converts animated Telegram stickers (*.tgs) to animated WEBPs (.webp)

Building from source

  1. Make sure you have g++, make and cmake installed
  2. Clone this repository
git clone --recursive https://github.com/0xNima/tgs2animated.git
  1. Build
cd tgs2animated
mkdir build
cd build
cmake ..
make -j 2

Convert

Pass an input tgs and an output webp

$ ./tgs2animated -i ./sticker.tgs -o ./animation.webp

CLI arguments

$ ./tgs2animated -help
Usage:
 tgs2animated [options] -i tgs_file -o webp_file
  -i <tgs_file>............. input tgs file[Required]
  -o <webp_file>............ output webp file[Required]
Options:
  -h / -help ............... this help
  -q <float> ............... quality factor (0:small..100:big)
  -m <int> ................. compression method (0=fast, 6=slowest)
  -min_size ................ minimize size
  -wh <int>................. Width and height in px

  -version ................. print version number and exit

Using in Python

  1. modify setup.py to consider your desire python's include directory. The default is /usr/include/python3.7.
  2. run following commands:
pythonX setup.py build
pythonX setup.y install

which X indicates version of your python.

  1. now you can use this module in your python:
Python 3.7.11 (default, Jul  3 2021, 17:58:19) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tgs
>>> tgs.convert("inputfile", "outputfile", <wh>, <m>, <q>)
True

About

Converts animated Telegram stickers (*.tgs) to animated WEBPs (.webp)

License:GNU General Public License v2.0


Languages

Language:C 70.9%Language:C++ 19.7%Language:Assembly 2.1%Language:Ada 1.2%Language:Pascal 1.0%Language:CMake 0.9%Language:Makefile 0.8%Language:C# 0.7%Language:Roff 0.6%Language:M4 0.6%Language:HTML 0.5%Language:DIGITAL Command Language 0.4%Language:Shell 0.3%Language:Meson 0.1%Language:Python 0.1%Language:Perl 0.1%Language:SAS 0.0%Language:Module Management System 0.0%Language:Go 0.0%Language:Batchfile 0.0%