A simple and lightweight tool to optimise lottie files.
- Reduced decimal precision (color values excluded)
- Remove unused fields:
nm
- After Effect's Name. Used for expressions.mn
- After Effect's Match Name. Used for expressions.hd
- Undocumented boolean that always seems to befalse
.ks.r
- Transform Rotationks.s
- Transform Scaleix
- Effect Index. Used for expressions.np
- Group number of properties. Used for expressions.cix
- Undocumented number, always seems to be2
.
- Minify JSON
npx lottie-optim [options] <file>
Options:
-V, --version output the version number
-p, --precision <number> Round numbers to a number of decimal places to reduce filesize (default: 2)
-o, --out <file> Output file, without this option the original file with be overridden
-h, --help output usage information
npx lottie-optim -p 1 -o lottie.min.json lottie.json