Skip to content

Latest commit

 

History

History
69 lines (49 loc) · 2.19 KB

README.md

File metadata and controls

69 lines (49 loc) · 2.19 KB

Lottie Theme Converter


Features

A powerful Lottie animation theme converter that helps you easily switch between light and dark themes:

⚡ Color Inversion While Preserving Transparency

Smartly inverts colors of embedded images in Lottie files while maintaining alpha channel transparency.

🎨 Support for Both Light & Dark Themes

Perfect for applications requiring both light and dark mode animations.

💻 Simple Python Implementation

Easy-to-understand Python script using only Pillow library for image processing.

🔄 Base64 Image Handling

Efficiently processes base64 encoded images embedded in Lottie JSON files.

🤔 How to Use

  1. Install requirements:
pip install -r requirements.txt
  1. Place your light theme Lottie animation file as "Animation-ClickMe.json"

  2. Run the conversion script:

python convert_lottie.py
  1. Get your dark theme animation in "Animation-ClickMe-dark.json"

Tech Used

Python Pillow

Getting Started

First, install the required dependency:

pip install pillow==11.0.0

You can start converting your Lottie animation by following these steps:

  1. Save your Lottie animation file as "Animation-ClickMe.json"
  2. Run convert_lottie.py
  3. The script will generate "Animation-ClickMe-dark.json" with inverted colors

Learn More

The script processes embedded base64 images in the Lottie JSON file:

  • Decodes base64 to image
  • Inverts colors while preserving transparency
  • Re-encodes to base64
  • Updates the Lottie JSON with new image data

Feel free to modify the code to work with different input/output filenames or add additional image processing features!

🙋‍♀ Author

Created and maintained by Chan Meng.