Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

106 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tlottie

Library for drawing lottie animations, written in Rust.

  • Micro-optimized and benchmarked across 17k+ animations from Telegram, against rlottie and thorvg.
  • SIMD on ARM NEON, x86_64 SSE2 AVX2 AVX512, and WASM: web demo.
  • Support of fitz modifier and color replacements.
  • Support of rendering into only alpha channel bitmap.
  • Safe. Lottie JSON is treated as untrusted input.
  • Zero dependencies1.

Building (Native)

cargo rustc --release --features c-api --lib --crate-type staticlib
# library will be built at target/release/libtlottie.a
# include headers are at include/tlottie.h

Building (Web)

rustup target add wasm32-unknown-unknown
cargo build --target wasm32-unknown-unknown --release --no-default-features --features wasm --lib
# .wasm will be built at target/wasm32-unknown-unknown/release-size/tlottie.wasm

Example on how to work with tlottie.wasm is at examples/web/.

Benchmarks

Frame time, mainly compared to rlottie2019.

Footnotes

  1. Listed dependencies are only for GPU renderers, that are currently work in progress, expected to be useful only on large canvas sizes.

  2. Tested on Threadripper PRO 9995WX at full core count, running tlottie's SSE2+AVX2+AVX-512 backend against rlottie's. Relative parity with rlottie2019 is worse here than on smaller cores because the vector span kernels are memory-bound at 720px; tlottie is faster than this on typical x86_64 laptops (see the AVX-512 breakdown in the report).

About

Rust library for drawing Lottie animations

Topics

Resources

Stars

23 stars

Watchers

2 watching

Forks

Contributors

Languages