MIT License

项目介绍

ed-asriyan/lottie-converter 是一个托管在 GitHub 上的开源项目,主要使用 C++ 编写,采用 MIT License 许可证,目前获得 1.0k 个 Star、83 次 Fork。

仓库全名
ed-asriyan/lottie-converter
开源许可证
MIT License
Star 数
1.0k
Fork 数
83
未关闭 Issue
5

README 摘要

Lottie Animations (.json) and Telegram Stickers (.tgs) to GIF/PNG/APNG/WEBP/WEBM converter To easily transfer Telegram stickers to WhatsApp you can use Telegram Bot 👉 https://t.me/tgtowabot 👈 How to use There are 2 options: Run using Docker. One-line command, the option requires only Docker installed Download and run compiled executable files. The option requires run-time dependecies installed Using Docker Replace…

完整内容见 GitHub 原始 README 或本页 。

常见问题

lottie-converter 用什么语言开发?

主要使用 C++ 编写,采用 MIT License 许可证,目前有 1.0k 个 Star。

lottie-converter 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 lottie-converter 的源码?

可以直接克隆仓库:git clone https://github.com/ed-asriyan/lottie-converter.git,默认分支为 master;安装与运行步骤见仓库 README。

lottie-converter 最近还在维护吗?

仓库最近一次更新为 3 周前,当前有 5 个未关闭 Issue;Star 数为 1.0k,可作为社区活跃度的参考。

语言占比

C++
CMake
Dockerfile
Shell

Release

README

Lottie Animations (.json) and Telegram Stickers (*.tgs) to GIF/PNG/APNG/WEBP/WEBM converter

CI | Build & Test CD | Release & Push to Dockerhub


To easily transfer Telegram stickers to WhatsApp you can use Telegram Bot

👉 https://t.me/tgtowabot 👈


How to use

There are 2 options:

  • Run using Docker. One-line command, the option requires only Docker installed
  • Download and run compiled executable files. The option requires run-time dependecies installed

Using Docker

Replace with directory with Lottie animations / Telegram stickers and run:

  • Convert to GIF:
    docker run --rm -v <path to directory>:/source edasriyan/lottie-to-gif
    
  • Convert to PNG:
    docker run --rm -v <path to directory>:/source edasriyan/lottie-to-png
    
  • Convert to APNG:
    docker run --rm -v <path to directory>:/source edasriyan/lottie-to-apng
    
  • Convert to WEBP:
    docker run --rm -v <path to directory>:/source edasriyan/lottie-to-webp
    
  • Convert to WEBM:
    docker run --rm -v <path to directory>:/source edasriyan/lottie-to-webm
    

You can provide parameters via env variables:

  • HEIGHT: Output image height. Default: 512
  • WIDTH: Output image width. Default: 512
  • FPS: Output frame rate. Default: apng,png,webp - 60; gif - 50
  • QUALITY: Output quality. Default: 90
  • THREADS: Number of threads to use. Default: number of CPUs
  • BACKGROUND: Background color to replace transparent pixels. Formats: rgb(r,g,b), rgba(r,g,b,a), #RRGGBB, #RRGGBBAA

Example:

docker run --rm -e HEIGHT=256 -e WIDTH=256 -e FPS=30 -v /home/ed/Downloads/lottie-animations:/source edasriyan/lottie-to-apng

Results will be saved next to each source file in the same directory.

Using compiled executables

  1. Install run-time dependencies. Make sure the path to them present in PATH variable:

    • gifski if you want to convert to GIF
    • ffmpeg if you want to convert to APNG or WEBM
    • img2webp if you want to convert to WEBP
  2. Download executable from releases section of this repo for your OS and arch

  3. In downloaded archive find the following executable scripts:

    • lottie_to_apng.sh
    • lottie_to_gif.sh
    • lottie_to_png.sh
    • lottie_to_webp.sh
    • lottie_to_webm.sh

    All of them have the same CLI:

    $ ./bin/lottie_to_gif.sh -h                       
    usage: ./bin/lottie_to_gif.sh [--help] [--output OUTPUT] [--height HEIGHT] [--width WIDTH] [--threads THREADS] [--fps FPS] [--quality QUALITY] [--background BACKGROUND] path
    
    Lottie animations (.json) and Telegram stickers for Telegram (*.tgs) to animated .gif converter
    
    Positional arguments:
    path              Path to .json or .tgs file to convert
    
    Optional arguments:
    -h, --help        show this help message and exit
    --output OUTPUT   Output file path
    --height HEIGHT   Output image height. Default: 
    --width WIDTH     Output image width. Default: 512
    --fps FPS         Output frame rate. Default: 50
    --threads THREADS Number of threads to use. Default: number of CPUs
    --quality QUALITY Output quality. Default: 90
    --background BACKGROUND Background color to replace transparent pixels. Formats: rgb(r,g,b), rgba(r,g,b,a), #RRGGBB, #RRGGBBAA
    

Build

  1. Install dependencies
    1. Make sure you have C++17 compiler, make, cmake and conan tools installed; otherwise install them
    2. Detect your conan profile
      conan profile detect
      
    3. Install conan dependencies
      conan install --build=missing .
      
  2. Invoke conan preset
    • Linux & MacOS
      cmake --preset conan-release
      
    • Windows
      cmake --preset conan-default
      
  3. Build
    cmake -DCMAKE_BUILD_TYPE=Release -DLOTTIE_MODULE=OFF CMakeLists.txt && cmake --build . --config Release
    
  4. Convert!
    • To convert to GIF:
      ./bin/lottie_to_gif.sh /home/ed/Downloads/animation.json
      
    • To convert to PNG:
      ./bin/lottie_to_png.sh /home/ed/Downloads/animation.json
      
    • To convert to APNG:
      ./bin/lottie_to_apng.sh /home/ed/Downloads/animation.json
      
    • To convert to WEBP:
      ./bin/lottie_to_webp.sh /home/ed/Downloads/animation.json
      
    • To convert to WEBM:
      ./bin/lottie_to_webm.sh /home/ed/Downloads/animation.json
      
    Results will be saved next to each source file in the same directory.

Notices

评论

暂无评论