Skip to main content
Built by Best ROI MediaMITWave 2 · LiveBestRoiMedia/bestroi-game-tools

lottie-kit

Cross-platform Lottie builder helpers, iOS/Android compatibility validator, and preview renderer.

Shared bodymovin 5.7 Lottie authoring library, strict lottie-ios / lottie-android compatibility validator, and GIF/contact-sheet preview renderer.

View on GitHub ↗
Quick clonegit clone https://github.com/BestRoiMedia/bestroi-game-tools.git
GitHub repositoryBestRoiMedia/bestroi-game-tools
Module path_tools/lottie/
LicenseMIT
Release waveWave 2
LanguagesPython · JSON

Why we built it

Lottie files that look fine on the web frequently break or silently drop layers on mobile—negative scale drops layers on lottie-android, while expressions, track mattes, or mismatched path vertex counts diverge between iOS and Android. We built lottie-kit to standardize safe programmatic authoring and catch mobile incompatibilities before shipping.

Architecture & how it works

lotlib.py provides composable builders for keyframes, shapes, strokes, tints, groups, image layers, markers, and common motion curves while deduplicating equal keyframe times and checking negative scale. validate_lottie.py audits bodymovin 5.7 JSON files against the exact subset supported identically by lottie-ios 4.x and lottie-android/compose 6.x (gr/sh/el/rc/fl/st/tr only, no expressions/masks/mattes/gradients/trims/repeaters, strictly increasing keyframe times, matching path vertex counts). render_previews.py generates GIFs, 8-frame strips, and contact sheets via python-lottie.

Key capabilities

  • Programmatic Lottie builders (lotlib.py) for shapes, paths, markers, and reusable motion tracks
  • Cross-platform mobile validator catching NEGATIVE_SCALE, BANNED keys, UNSUPPORTED shapes, KEY_ORDER, EASING, and VERTS mismatches
  • Optional python-lottie load verification and image-layer allowance (--allow-images)
  • Automated preview generation: animated GIFs, 8-frame horizontal strips, and multi-file contact sheets
  • Built-in self-test suite verifying known-bad Lottie failure modes

Usage example

Validate a Lottie directory and render preview stripsPython
python3 lottie/validate_lottie.py ./art/lottie --fps 60
python3 lottie/render_previews.py ./art/lottie --bg "#FBF3E4" --contact
python3 lottie/validate_lottie.py selftest
Use --fps any for variable frame-rate comps. Equal keyframe times emit a WARN (KEY_SAME_TIME) rather than failing.