{"id":23557456,"url":"https://github.com/chanmeng666/lottie-edit","last_synced_at":"2025-08-13T15:37:27.373Z","repository":{"id":267080684,"uuid":"900205794","full_name":"ChanMeng666/lottie-edit","owner":"ChanMeng666","description":"【Stars are like virtual high-fives - come on, don't leave us hanging!⭐️】A Python tool to convert Lottie animations between light and dark themes by inverting animation colors while preserving transparency.","archived":false,"fork":false,"pushed_at":"2025-01-07T10:33:40.000Z","size":7779,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-17T14:45:16.802Z","etag":null,"topics":["base64","dark-theme","image-processing","lottie-animation","pillow","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ChanMeng666.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":"chanmeng66u","thanks_dev":null,"custom":null}},"created_at":"2024-12-08T06:30:59.000Z","updated_at":"2025-01-07T10:33:44.000Z","dependencies_parsed_at":"2025-01-07T11:38:14.623Z","dependency_job_id":null,"html_url":"https://github.com/ChanMeng666/lottie-edit","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"04a747184df704541781735d02e62e527fa8b4af"},"previous_names":["chanmeng666/lottie-edit"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChanMeng666%2Flottie-edit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChanMeng666%2Flottie-edit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChanMeng666%2Flottie-edit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChanMeng666%2Flottie-edit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChanMeng666","download_url":"https://codeload.github.com/ChanMeng666/lottie-edit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254442180,"owners_count":22071860,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["base64","dark-theme","image-processing","lottie-animation","pillow","python"],"created_at":"2024-12-26T14:30:52.208Z","updated_at":"2025-08-13T15:37:27.338Z","avatar_url":"https://github.com/ChanMeng666.png","language":"Python","funding_links":["https://buymeacoffee.com/chanmeng66u"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n \u003ch1\u003e🎨 Lottie Theme Converter\u003c/h1\u003e\n \u003ch3\u003eSmart Color Inversion for Lottie Animations\u003c/h3\u003e\n\nA powerful Python tool that intelligently converts Lottie animations between light and dark themes.\u003cbr/\u003e\nPreserves transparency and maintains animation quality while inverting embedded image colors.\u003cbr/\u003e\nOne-click **FREE** theme conversion for your Lottie animations.\n\n[Live Demo][demo-link] · [Documentation][docs-link] · [Report Bug][issues-link] · [Request Feature][issues-link]\n\n\u003cbr/\u003e\n\n[![🚀 Try Demo 🚀](https://gradient-svg-generator.vercel.app/api/svg?text=%F0%9F%9A%80Visit%20Live%20Site%F0%9F%9A%80\u0026color=000000\u0026height=60\u0026gradientType=radial\u0026duration=6s\u0026color0=ffffff\u0026template=pride-rainbow)][demo-link]\n\n\u003cbr/\u003e\n\n\u003c!-- SHIELD GROUP --\u003e\n[![][python-shield]][python-link]\n[![][pillow-shield]][pillow-link]\n[![][license-shield]][license-link]\n[![][github-stars-shield]][github-stars-link]\n[![][github-forks-shield]][github-forks-link]\n[![][github-issues-shield]][github-issues-link]\n\n**Share Lottie Theme Converter**\n\n[![][share-x-shield]][share-x-link]\n[![][share-telegram-shield]][share-telegram-link]\n[![][share-whatsapp-shield]][share-whatsapp-link]\n[![][share-reddit-shield]][share-reddit-link]\n[![][share-linkedin-shield]][share-linkedin-link]\n\n\u003csup\u003e🌟 Pioneering intelligent theme conversion for Lottie animations. Built for designers and developers.\u003c/sup\u003e\n\n\u003c/div\u003e\n\n\u003e [!TIP]\n\u003e **⭐ Star us** to receive all release notifications from GitHub without delay!\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003ckbd\u003e📑 Table of Contents\u003c/kbd\u003e\u003c/summary\u003e\n\n#### TOC\n\n- [🌟 Introduction](#-introduction)\n- [✨ Key Features](#-key-features)\n  - [⚡ Smart Color Inversion](#-smart-color-inversion)\n  - [🎨 Dual Theme Support](#-dual-theme-support)\n  - [💻 Simple Python Implementation](#-simple-python-implementation)\n  - [🔄 Base64 Image Processing](#-base64-image-processing)\n  - [🚀 One-Click Conversion](#-one-click-conversion)\n- [🛠️ Tech Stack](#️-tech-stack)\n- [🚀 Getting Started](#-getting-started)\n  - [Prerequisites](#prerequisites)\n  - [Quick Installation](#quick-installation)\n  - [Alternative Installation](#alternative-installation)\n- [📖 Usage Guide](#-usage-guide)\n  - [Basic Usage](#basic-usage)\n  - [Advanced Configuration](#advanced-configuration)\n  - [Integration Example](#integration-example)\n- [🎯 How It Works](#-how-it-works)\n  - [Technical Process](#technical-process)\n- [📁 Project Structure](#-project-structure)\n  - [Core Files](#core-files)\n- [🤝 Contributing](#-contributing)\n  - [Development Process](#development-process)\n  - [Contribution Guidelines](#contribution-guidelines)\n- [📄 License](#-license)\n- [👥 Author](#-author)\n\n####\n\n\u003cbr/\u003e\n\n\u003c/details\u003e\n\n## 🌟 Introduction\n\nWe created this intelligent Lottie theme converter to solve a common problem faced by designers and developers: **seamlessly converting Lottie animations between light and dark themes** while preserving transparency and animation quality.\n\nWhether you're building modern web applications, mobile apps, or any digital interface that supports both light and dark modes, this tool ensures your Lottie animations look perfect in any theme.\n\n\u003e [!NOTE]\n\u003e - Python 3.8+ required\n\u003e - Only Pillow library dependency\n\u003e - Works with any Lottie JSON file containing base64 images\n\u003e - Preserves alpha channel transparency\n\n| [![][demo-shield-badge]][demo-link] | No complex setup required! Just run the script and get your themed animation. |\n| :---------------------------------- | :---------------------------------------------------------------------------- |\n\n\u003e [!TIP]\n\u003e **⭐ Star us** to stay updated with new features and improvements!\n\n## ✨ Key Features\n\n### ⚡ Smart Color Inversion\nExperience intelligent color processing that **inverts RGB channels while preserving alpha transparency**. Our algorithm ensures your animations maintain their visual quality and transparency effects.\n\n### 🎨 Dual Theme Support  \nPerfect for applications requiring both light and dark mode animations. Convert your light theme animations to dark theme versions effortlessly.\n\n### 💻 Simple Python Implementation\nClean, readable Python code using only the Pillow library. Easy to understand, modify, and integrate into your workflow.\n\n### 🔄 Base64 Image Processing\nEfficiently processes base64 encoded images embedded directly in Lottie JSON files without requiring external image files.\n\n### 🚀 One-Click Conversion\nSimply place your Lottie file and run the script. Your dark theme animation will be generated instantly.\n\n## 🛠️ Tech Stack\n\n\u003cdiv align=\"center\"\u003e\n  \u003ctable\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" width=\"96\"\u003e\n        \u003cimg src=\"https://cdn.simpleicons.org/python\" width=\"48\" height=\"48\" alt=\"Python\" /\u003e\n        \u003cbr\u003ePython 3.8+\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"96\"\u003e\n        \u003cimg src=\"https://cdn.jsdelivr.net/gh/devicons/devicon/icons/python/python-original.svg\" width=\"48\" height=\"48\" alt=\"Pillow\" /\u003e\n        \u003cbr\u003ePillow 11.0.0\n      \u003c/td\u003e\n      \u003ctd align=\"center\" width=\"96\"\u003e\n        \u003cimg src=\"https://cdn.simpleicons.org/json\" width=\"48\" height=\"48\" alt=\"JSON\" /\u003e\n        \u003cbr\u003eLottie JSON\n      \u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/table\u003e\n\u003c/div\u003e\n\n**Core Technologies:**\n- **Python 3.8+**: Main programming language\n- **Pillow (PIL) 11.0.0**: Image processing library\n- **JSON**: Lottie animation file format\n- **Base64**: Image encoding/decoding\n\n## 🚀 Getting Started\n\n### Prerequisites\n\n\u003e [!IMPORTANT]\n\u003e Ensure you have Python 3.8+ installed on your system.\n\n### Quick Installation\n\n**1. Clone Repository**\n\n```bash\ngit clone https://github.com/ChanMeng666/lottie-edit.git\ncd lottie-edit\n```\n\n**2. Install Dependencies**\n\n```bash\npip install -r requirements.txt\n```\n\n**3. Prepare Your Animation**\n\nPlace your light theme Lottie animation file as `Animation-ClickMe.json` in the project directory.\n\n**4. Run Conversion**\n\n```bash\npython convert_lottie.py\n```\n\n🎉 **Success!** Your dark theme animation will be saved as `Animation-ClickMe-dark.json`.\n\n### Alternative Installation\n\n```bash\n# Install Pillow directly\npip install pillow==11.0.0\n\n# Download the script\nwget https://raw.githubusercontent.com/ChanMeng666/lottie-edit/main/convert_lottie.py\n```\n\n## 📖 Usage Guide\n\n### Basic Usage\n\n**Step 1: Prepare Your Lottie File**\n- Ensure your Lottie JSON file contains base64 encoded images\n- Save it as `Animation-ClickMe.json` in the project directory\n\n**Step 2: Run the Conversion**\n```bash\npython convert_lottie.py\n```\n\n**Step 3: Get Your Result**\n- The converted dark theme animation will be saved as `Animation-ClickMe-dark.json`\n- Use this file in your dark mode interface\n\n### Advanced Configuration\n\nTo customize input/output filenames, modify the script:\n\n```python\n# Change input filename\nwith open('your-animation.json', 'r') as f:\n    data = json.load(f)\n\n# Change output filename  \nwith open('your-animation-dark.json', 'w') as f:\n    json.dump(data, f)\n```\n\n### Integration Example\n\n```javascript\n// Use in web applications\nconst isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches;\nconst animationPath = isDarkMode ? \n    './animations/Animation-ClickMe-dark.json' : \n    './animations/Animation-ClickMe.json';\n\nlottie.loadAnimation({\n    container: element,\n    renderer: 'svg',\n    loop: true,\n    autoplay: true,\n    path: animationPath\n});\n```\n\n## 🎯 How It Works\n\nThe conversion process follows these intelligent steps:\n\n```mermaid\nflowchart TD\n    A[Read Lottie JSON] --\u003e B[Extract Assets]\n    B --\u003e C{Contains Base64 Images?}\n    C --\u003e|Yes| D[Decode Base64 to Image]\n    C --\u003e|No| H[Skip Asset]\n    D --\u003e E{Has Alpha Channel?}\n    E --\u003e|RGBA| F[Split RGB and Alpha]\n    E --\u003e|RGB| G[Direct Color Inversion]\n    F --\u003e I[Invert RGB, Preserve Alpha]\n    G --\u003e J[Encode Back to Base64]\n    I --\u003e J\n    J --\u003e K[Update JSON Asset]\n    H --\u003e L[Process Next Asset]\n    K --\u003e L\n    L --\u003e M{More Assets?}\n    M --\u003e|Yes| C\n    M --\u003e|No| N[Save Dark Theme JSON]\n```\n\n### Technical Process\n\n1. **JSON Parsing**: Load and parse the Lottie JSON file\n2. **Asset Detection**: Identify base64 encoded images in the assets array\n3. **Image Decoding**: Convert base64 strings back to image objects\n4. **Smart Inversion**: \n   - For RGBA images: Separate RGB and Alpha channels\n   - Invert RGB values: `new_value = 255 - original_value`\n   - Preserve Alpha channel unchanged\n5. **Re-encoding**: Convert processed images back to base64\n6. **JSON Update**: Replace original base64 data with inverted versions\n7. **File Generation**: Save the new dark theme JSON file\n\n## 📁 Project Structure\n\n```\nlottie-edit/\n├── convert_lottie.py          # Main conversion script\n├── requirements.txt           # Python dependencies\n├── Animation-ClickMe.json     # Sample light theme animation\n├── Animation-ClickMe-dark.json # Generated dark theme animation\n├── README.md                  # Project documentation\n├── LICENSE                    # MIT license\n└── CODE_OF_CONDUCT.md        # Community guidelines\n```\n\n### Core Files\n\n| File | Description | Purpose |\n|------|-------------|---------|\n| `convert_lottie.py` | Main Python script | Handles the theme conversion logic |\n| `requirements.txt` | Dependencies list | Specifies Pillow version requirement |\n| `Animation-ClickMe.json` | Sample input file | Example light theme Lottie animation |\n| `Animation-ClickMe-dark.json` | Sample output file | Generated dark theme animation |\n\n## 🤝 Contributing\n\nWe welcome contributions! Here's how you can help improve this project:\n\n### Development Process\n\n**1. Fork \u0026 Clone:**\n```bash\ngit clone https://github.com/ChanMeng666/lottie-edit.git\ncd lottie-edit\n```\n\n**2. Create Branch:**\n```bash\ngit checkout -b feature/your-feature-name\n```\n\n**3. Make Changes:**\n- Follow Python best practices\n- Add comments for complex logic\n- Test with various Lottie files\n- Update documentation as needed\n\n**4. Submit PR:**\n- Provide clear description\n- Include example files if applicable\n- Ensure the script works with different animation types\n\n### Contribution Guidelines\n\n**Code Style:**\n- Follow PEP 8 Python style guidelines\n- Add docstrings for functions\n- Use meaningful variable names\n- Include error handling\n\n**Pull Request Process:**\n1. Update README.md if needed\n2. Test with multiple Lottie files\n3. Ensure compatibility with Pillow 11.0.0\n4. Request review from maintainers\n\n**Issue Reporting:**\n- 🐛 **Bug Reports**: Include Lottie file samples and error messages\n- 💡 **Feature Requests**: Explain use case and benefits\n- 📚 **Documentation**: Help improve our guides\n- ❓ **Questions**: Use GitHub Discussions\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n**Open Source Benefits:**\n- ✅ Commercial use allowed\n- ✅ Modification allowed\n- ✅ Distribution allowed\n- ✅ Private use allowed\n\n## 👥 Author\n\n\u003cdiv align=\"center\"\u003e\n  \u003ctable\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\"\u003e\n        \u003ca href=\"https://github.com/ChanMeng666\"\u003e\n          \u003cimg src=\"https://github.com/ChanMeng666.png?size=100\" width=\"100px;\" alt=\"Chan Meng\"/\u003e\n          \u003cbr /\u003e\n          \u003csub\u003e\u003cb\u003eChan Meng\u003c/b\u003e\u003c/sub\u003e\n        \u003c/a\u003e\n        \u003cbr /\u003e\n        \u003csmall\u003eCreator \u0026 Lead Developer\u003c/small\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/table\u003e\n\u003c/div\u003e\n\n**Contact Information:**\n- 📧 **Email**: [chanmeng.dev@gmail.com](mailto:chanmeng.dev@gmail.com)\n- 💼 **LinkedIn**: [chanmeng666](https://www.linkedin.com/in/chanmeng666/)\n- 🐦 **GitHub**: [ChanMeng666](https://github.com/ChanMeng666)\n- 🌐 **Website**: [chanmeng.live](https://2d-portfolio-eta.vercel.app/)\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\u003cstrong\u003e🎨 Revolutionizing Lottie Animation Theming 🌟\u003c/strong\u003e\n\u003cbr/\u003e\n\u003cem\u003eEmpowering designers and developers worldwide\u003c/em\u003e\n\u003cbr/\u003e\u003cbr/\u003e\n\n⭐ **Star us on GitHub** • 📖 **Read the Documentation** • 🐛 **Report Issues** • 💡 **Request Features** • 🤝 **Contribute**\n\n\u003cbr/\u003e\u003cbr/\u003e\n\n**Made with ❤️ by the Lottie Theme Converter team**\n\n\u003cimg src=\"https://img.shields.io/github/stars/ChanMeng666/lottie-edit?style=social\" alt=\"GitHub stars\"\u003e\n\u003cimg src=\"https://img.shields.io/github/forks/ChanMeng666/lottie-edit?style=social\" alt=\"GitHub forks\"\u003e\n\u003cimg src=\"https://img.shields.io/github/watchers/ChanMeng666/lottie-edit?style=social\" alt=\"GitHub watchers\"\u003e\n\n\u003c/div\u003e\n\n---\n\n\u003c!-- LINK DEFINITIONS --\u003e\n\n\u003c!-- Project Links --\u003e\n[demo-link]: https://github.com/ChanMeng666/lottie-edit\n[docs-link]: https://github.com/ChanMeng666/lottie-edit#readme\n[issues-link]: https://github.com/ChanMeng666/lottie-edit/issues\n\n\u003c!-- GitHub Links --\u003e\n[github-stars-link]: https://github.com/ChanMeng666/lottie-edit/stargazers\n[github-forks-link]: https://github.com/ChanMeng666/lottie-edit/forks\n[github-issues-link]: https://github.com/ChanMeng666/lottie-edit/issues\n[license-link]: https://github.com/ChanMeng666/lottie-edit/blob/main/LICENSE\n\n\u003c!-- External Links --\u003e\n[python-link]: https://www.python.org/\n[pillow-link]: https://pillow.readthedocs.io/\n\n\u003c!-- Shield Badges --\u003e\n[python-shield]: https://img.shields.io/badge/python-3.8%2B-blue?style=flat-square\u0026logo=python\u0026logoColor=white\n[pillow-shield]: https://img.shields.io/badge/pillow-11.0.0-orange?style=flat-square\u0026logo=python\u0026logoColor=white\n[license-shield]: https://img.shields.io/badge/license-MIT-brightgreen?style=flat-square\n[github-stars-shield]: https://img.shields.io/github/stars/ChanMeng666/lottie-edit?color=ffcb47\u0026labelColor=black\u0026style=flat-square\n[github-forks-shield]: https://img.shields.io/github/forks/ChanMeng666/lottie-edit?color=8ae8ff\u0026labelColor=black\u0026style=flat-square\n[github-issues-shield]: https://img.shields.io/github/issues/ChanMeng666/lottie-edit?color=ff80eb\u0026labelColor=black\u0026style=flat-square\n\n\u003c!-- Badge Variants --\u003e\n[demo-shield-badge]: https://img.shields.io/badge/TRY%20DEMO-ONLINE-4CAF50?labelColor=black\u0026style=for-the-badge\n\n\u003c!-- Social Share Links --\u003e\n[share-x-link]: https://x.com/intent/tweet?hashtags=opensource,lottie,animation\u0026text=Check%20out%20this%20amazing%20Lottie%20theme%20converter\u0026url=https%3A%2F%2Fgithub.com%2FChanMeng666%2Flottie-edit\n[share-telegram-link]: https://t.me/share/url?text=Check%20out%20this%20Lottie%20theme%20converter\u0026url=https%3A%2F%2Fgithub.com%2FChanMeng666%2Flottie-edit\n[share-whatsapp-link]: https://api.whatsapp.com/send?text=Check%20out%20this%20Lottie%20theme%20converter%20https%3A%2F%2Fgithub.com%2FChanMeng666%2Flottie-edit\n[share-reddit-link]: https://www.reddit.com/submit?title=Amazing%20Lottie%20Theme%20Converter\u0026url=https%3A%2F%2Fgithub.com%2FChanMeng666%2Flottie-edit\n[share-linkedin-link]: https://linkedin.com/sharing/share-offsite/?url=https://github.com/ChanMeng666/lottie-edit\n\n[share-x-shield]: https://img.shields.io/badge/-share%20on%20x-black?labelColor=black\u0026logo=x\u0026logoColor=white\u0026style=flat-square\n[share-telegram-shield]: https://img.shields.io/badge/-share%20on%20telegram-black?labelColor=black\u0026logo=telegram\u0026logoColor=white\u0026style=flat-square\n[share-whatsapp-shield]: https://img.shields.io/badge/-share%20on%20whatsapp-black?labelColor=black\u0026logo=whatsapp\u0026logoColor=white\u0026style=flat-square\n[share-reddit-shield]: https://img.shields.io/badge/-share%20on%20reddit-black?labelColor=black\u0026logo=reddit\u0026logoColor=white\u0026style=flat-square\n[share-linkedin-shield]: https://img.shields.io/badge/-share%20on%20linkedin-black?labelColor=black\u0026logo=linkedin\u0026logoColor=white\u0026style=flat-square\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchanmeng666%2Flottie-edit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchanmeng666%2Flottie-edit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchanmeng666%2Flottie-edit/lists"}