Giter VIP home page Giter VIP logo

0xnima / tgs2animated Goto Github PK

View Code? Open in Web Editor NEW

This project forked from petermx/tgs2animated

0.0 0.0 0.0 10.61 MB

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

License: GNU General Public License v2.0

CMake 0.86% C++ 19.72% Makefile 0.81% Shell 0.32% M4 0.56% HTML 0.48% C 70.93% Roff 0.60% Assembly 2.09% SAS 0.02% Ada 1.18% Pascal 0.99% C# 0.71% Batchfile 0.01% DIGITAL Command Language 0.36% Module Management System 0.02% Perl 0.05% Go 0.02% Python 0.13% Meson 0.14%

tgs2animated's Introduction

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

tgs2animated's People

Contributors

petermx avatar 0xnima avatar example11123 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.