https://github.com/peterroe/lottie-inline
A tool to inline images in Lottie JSON files
https://github.com/peterroe/lottie-inline
Last synced: 4 months ago
JSON representation
A tool to inline images in Lottie JSON files
- Host: GitHub
- URL: https://github.com/peterroe/lottie-inline
- Owner: peterroe
- Created: 2025-03-22T06:16:56.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-31T14:54:17.000Z (about 1 year ago)
- Last Synced: 2025-09-18T03:05:24.945Z (9 months ago)
- Language: Python
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Lottie Inline Tool
A simple tool to inline images in Lottie JSON files.
## Installation
```bash
$ pip install lottie-inline
```
## Usage
Basic usage:
```bash
$ lottie-inline /path/to/input-lottie-file.json /path/to/output-lottie-file.json
```
Limit the size of the images to be inlined to 100KB:
```bash
$ lottie-inline /path/to/input-lottie-file.json /path/to/output-lottie-file.json --max-size=100
```
## Details
The tool will inline all images in the Lottie JSON file and save the result to the output file.
transform:
```json
{
"assets": [
{
"id": "image_0",
"w": 500,
"h": 500,
"u": "images/",
"p": "image.png",
"e": 0
},
],
}
```
to:
```json
{
"assets": [
{
"id": "image_0",
"w": 500,
"h": 500,
"u": "",
"p": "data:image/png;base64,...",
"e": 1
},
],
}
```
## License
MIT